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.
Incorrect type of file. system information - class version : 0.30 - operating system : Linux - PHP version : 5.1.6 - GD version : 2.0.28 - supported image types : png jpg gif bmp - open_basedir : /home/djpasica/data:. - upload_max_filesize : 100M (104857600 bytes) - language : en_GB source is an uploaded file - upload OK - file name OK determining MIME type - Checking MIME type with Fileinfo PECL extension Fileinfo PECL extension not available - Checking MIME type with UNIX file() command MIME type detected as application/x-zip by UNIX file() command - MIME validated as application/x-zip source variables - You can use all these before calling process() file_src_name : Zapis_ki.zip file_src_name_body : Zapis_ki file_src_name_ext : zip file_src_pathname : /home/djpasica/data/mod-tmp/phpAY47Cq file_src_mime : application/x-zip file_src_size : 3220 (max= 104857600) file_src_error : 0 process file to usersFile/ - file size OK - error: Incorrect type of file.Reply
Can you copy here an example of the log where it produces the error Incorrect type of file when it should not? In your previous log, the error message is normal.Reply
when i try to upload image, i have that error:
No GIF create support
CHMOD to upoaded directory is fine (777)
my script:
system information
- class version : 0.30
- operating system : Linux
- PHP version : 5.1.6
- GD version : 2.0.28
- supported image types : png jpg gif bmp
- open_basedir : /home/djpasica/data:.
- upload_max_filesize : 100M (104857600 bytes)
- language : en_GB
source is an uploaded file
- upload OK
- file name OK
determining MIME type
- Checking MIME type with Fileinfo PECL extension
Fileinfo PECL extension not available
- Checking MIME type with UNIX file() command
MIME type detected as application/x-zip by UNIX file() command
- MIME validated as application/x-zip
source variables
- You can use all these before calling process()
file_src_name : Zapis_ki.zip
file_src_name_body : Zapis_ki
file_src_name_ext : zip
file_src_pathname : /home/djpasica/data/mod-tmp/phpAY47Cq
file_src_mime : application/x-zip
file_src_size : 3220 (max= 104857600)
file_src_error : 0
process file to usersFile/
- file size OK
- error: Incorrect type of file.
file_src_name : Zapis_ki.zip
Your system detects the MIME type as application/x-zip:
MIME type detected as application/x-zip by UNIX file() command
But in your code, you allow only images: