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.
I am trying to upload a mht file (Powerpoint presentation) using class.upload.php
my code which works for pdf and images files is:
$uploaded = new Upload($_FILES['uploadnew']);
$uploaded->Process('./resources/');
if ($uploaded->uploaded) {
if ($uploaded->processed) {
echo ' ';
} else {
echo ' Error: ' . $uploaded->error . '';
}
}
I get the error Error: Incorrect type of file.
the log file is: system information - 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 - source variables file_src_name : ontarioworkerco-opspres.mht file_src_name_body : ontarioworkerco-opspres file_src_name_ext : mht file_src_pathname : C:\xampp\tmp\php119.tmp file_src_mime : message/rfc822 file_src_size : 2107870 (max= 33554432) file_src_error : 0 process file to ./resources/\ - file size OK
Error: Incorrect type of file.
system information - 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 - source variables file_src_name : ontarioworkerco-opspres.mht file_src_name_body : ontarioworkerco-opspres file_src_name_ext : mht file_src_pathname : C:\xampp\tmp\php119.tmp file_src_mime : message/rfc822 file_src_size : 2107870 (max= 33554432) file_src_error : 0 process file to ./resources/\ - file size OK
my code which works for pdf and images files is:
I get the error
Error: Incorrect type of file.
the log file is:
system information
- 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
- source variables
file_src_name : ontarioworkerco-opspres.mht
file_src_name_body : ontarioworkerco-opspres
file_src_name_ext : mht
file_src_pathname : C:\xampp\tmp\php119.tmp
file_src_mime : message/rfc822
file_src_size : 2107870 (max= 33554432)
file_src_error : 0
process file to ./resources/\
- file size OK
Error: Incorrect type of file.
system information
- 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
- source variables
file_src_name : ontarioworkerco-opspres.mht
file_src_name_body : ontarioworkerco-opspres
file_src_name_ext : mht
file_src_pathname : C:\xampp\tmp\php119.tmp
file_src_mime : message/rfc822
file_src_size : 2107870 (max= 33554432)
file_src_error : 0
process file to ./resources/\
- file size OK
Any suggestions will be appreciated.
Thanks