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.
Here is the log ... system information - class version : 0.27 - GD version : 2.0.34 - supported image types : png jpg gif bmp - open_basedir : no restriction - language : en_GB source is an uploaded file - upload OK - file name OK - MIME type detected as application/msword by UNIX file() command - source variables file_src_name : Serial Numbers.xls file_src_name_body : Serial Numbers file_src_name_ext : xls file_src_pathname : /tmp/php42L8Bg file_src_mime : application/msword file_src_size : 13824 (max= 67108864) file_src_error : 0 process file to images/entrants_pics/ - file size OK - file mime OK : application/msword - new file name body : Entry_No_0000_PicA - file name safe format - destination variables file_dst_path : images/entrants_pics/ file_dst_name_body : Entry_No_0000_PicA file_dst_name_ext : xls - no image operation, keep extension .................... etc.
I'm confused about your remark "set the $handle->allowed array " - do I have to do that? The log sugggests this has already been done - it knows that doc firles are invalid - not clear why it doesn't detect xls files are also invalid ngiven the statement "supported image types : png jpg gif bmp" above. Regards. Patrick.Reply
Here is the log ...
system information
- class version : 0.27
- GD version : 2.0.34
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- language : en_GB
source is an uploaded file
- upload OK
- file name OK
- MIME type detected as application/msword by UNIX file() command
- source variables
file_src_name : Serial Numbers.xls
file_src_name_body : Serial Numbers
file_src_name_ext : xls
file_src_pathname : /tmp/php42L8Bg
file_src_mime : application/msword
file_src_size : 13824 (max= 67108864)
file_src_error : 0
process file to images/entrants_pics/
- file size OK
- file mime OK : application/msword
- new file name body : Entry_No_0000_PicA
- file name safe format
- destination variables
file_dst_path : images/entrants_pics/
file_dst_name_body : Entry_No_0000_PicA
file_dst_name_ext : xls
- no image operation, keep extension .................... etc.
I'm confused about your remark "set the $handle->allowed array " - do I have to do that? The log sugggests this has already been done - it knows that doc firles are invalid - not clear why it doesn't detect xls files are also invalid ngiven the statement "supported image types : png jpg gif bmp" above.
Regards.
Patrick.