/protected/modules/comments/assets/tests/upload.php
PHP | 20 lines | 13 code | 7 blank | 0 comment | 10 complexity | 1c0c36af657166038482f275bd4fd117 MD5 | raw file
Possible License(s): GPL-3.0, LGPL-3.0, LGPL-2.1, BSD-3-Clause, BSD-2-Clause
- <?php
-
- include "../config.php";
- $_FILES['file']['type'] = strtolower($_FILES['file']['type']);
- if ($_FILES['file']['type'] == 'image/png'
- || $_FILES['file']['type'] == 'image/jpg'
- || $_FILES['file']['type'] == 'image/gif'
- || $_FILES['file']['type'] == 'image/jpeg'
- || $_FILES['file']['type'] == 'image/pjpeg')
- {
- copy($_FILES['file']['tmp_name'], IMAGES_ROOT.md5(date('YmdHis')).'.jpg');
- echo '/tmp/images/'.md5(date('YmdHis')).'.jpg';
- }
- ?>