class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
system information - class version : 0.31 - operating system : Linux - PHP version : 5.4.4-14+deb7u12 - GD version : GD not present - supported image types : none - open_basedir : no restriction - upload_max_filesize : 128M (134217728 bytes) - language : en_GB source is an uploaded file - upload OK - file name OK determining MIME type - Checking MIME type with Fileinfo PECL extension MAGIC path defaults to /usr/share/file/magic MIME type detected as application/octet-stream; charset=binary by Fileinfo PECL extension - MIME validated as application/octet-stream - Flash may be rewriting MIME as application/octet-stream - Try to guess MIME type from file extension (jpg): MIME type set to image/jpeg source variables - You can use all these before calling process() file_src_name : WP_20141107_10_58_56_Raw2.jpg file_src_name_body : WP_20141107_10_58_56_Raw2 file_src_name_ext : jpg file_src_pathname : /tmp/phpqxubfy file_src_mime : image/jpeg file_src_size : 37203 (max= 134217728) file_src_error : 0 process file to ../../pic/ - file size OK - file mime OK : image/jpeg - new file name body : 79083427_andresantosfreitas - file name safe format - destination variables file_dst_path : ../../pic/ file_dst_name_body : 79083427_andresantosfreitas file_dst_name_ext : jpg - checking for auto_rename - destination file details file_dst_name : 79083427_andresantosfreitas.jpg file_dst_pathname : ../../pic/79083427_andresantosfreitas.jpg - 79083427_andresantosfreitas.jpg doesn't exist already - no image processing wanted - process OKReply
if ($upFoto -> uploaded) { $justFileName = removeAccents(preg_replace('/\s+/', '', strtolower($name))); $rand = rand(0, 99999999); $File_Name = preg_replace('/\s+/', '', strtolower($_FILES['inputFotoEdit']['name'])); $File_Ext = substr($File_Name, strrpos($File_Name, '.')); $nmFoto = $rand.'_'.$justFileName.$File_Ext; $upFoto -> image_resize = TRUE; $upFoto -> file_new_name_body = $rand.'_'.$justFileName; $upFoto -> image_x = 140; $upFoto -> image_y = 140; $upFoto -> image_ratio_crop = TRUE; $upFoto -> file_safe_name = TRUE; $upFoto -> image_ratio = TRUE; $upFoto -> dir_auto_chmod = TRUE; $upFoto -> dir_chmod = 0777; $upFoto -> Process('../../pic/'); $cm_img = $upFoto -> file_dst_name; echo $upFoto->log; if ($upFoto -> processed) { $isFotoUp = true; }log from server:
system information
- class version : 0.31
- operating system : Linux
- PHP version : 5.4.4-14+deb7u12
- GD version : GD not present
- supported image types : none
- open_basedir : no restriction
- upload_max_filesize : 128M (134217728 bytes)
- language : en_GB
source is an uploaded file
- upload OK
- file name OK
determining MIME type
- Checking MIME type with Fileinfo PECL extension
MAGIC path defaults to /usr/share/file/magic
MIME type detected as application/octet-stream; charset=binary by Fileinfo PECL extension
- MIME validated as application/octet-stream
- Flash may be rewriting MIME as application/octet-stream
- Try to guess MIME type from file extension (jpg): MIME type set to image/jpeg
source variables
- You can use all these before calling process()
file_src_name : WP_20141107_10_58_56_Raw2.jpg
file_src_name_body : WP_20141107_10_58_56_Raw2
file_src_name_ext : jpg
file_src_pathname : /tmp/phpqxubfy
file_src_mime : image/jpeg
file_src_size : 37203 (max= 134217728)
file_src_error : 0
process file to ../../pic/
- file size OK
- file mime OK : image/jpeg
- new file name body : 79083427_andresantosfreitas
- file name safe format
- destination variables
file_dst_path : ../../pic/
file_dst_name_body : 79083427_andresantosfreitas
file_dst_name_ext : jpg
- checking for auto_rename
- destination file details
file_dst_name : 79083427_andresantosfreitas.jpg
file_dst_pathname : ../../pic/79083427_andresantosfreitas.jpg
- 79083427_andresantosfreitas.jpg doesn't exist already
- no image processing wanted
- process OK