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 having the same problem in my application. Your help is really appreciated.
This is my log:
- class version : 0.30 - operating system : Linux - PHP version : 5.2.17 - GD version : 2.0.34 - supported image types : png jpg gif bmp - open_basedir : no restriction - upload_max_filesize : 50M (52428800 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 UNIX file() command failed - Checking MIME type with mime.magic file (mime_content_type()) MIME type detected as text/plain by mime_content_type() - MIME validated as text/plain source variables - You can use all these before calling process() file_src_name : child.png file_src_name_body : child file_src_name_ext : png file_src_pathname : /tmp/phpVxcgAL file_src_mime : text/plain file_src_size : 36177 (max= 52428800) file_src_error : 0Reply
1. No, this just deals with MIME detection. If the file is accepted, and is an image, then all image-related functions will work.
2. In the code, inside the init() function, line 2206 in version 0.31.
3. Other MIME type detection methods are available if your system supports them. Check the log produced by the class to see how are the files detected.Reply
this problem a server configuration but my support dont help yet - somebody know anything?
I don't think there is a bug in the class, but more likely a problem with MIME
detection libraries installed on your system.
I am having the same problem in my application.
Your help is really appreciated.
This is my log:
- class version : 0.30
- operating system : Linux
- PHP version : 5.2.17
- GD version : 2.0.34
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- upload_max_filesize : 50M (52428800 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
UNIX file() command failed
- Checking MIME type with mime.magic file (mime_content_type())
MIME type detected as text/plain by mime_content_type()
- MIME validated as text/plain
source variables
- You can use all these before calling process()
file_src_name : child.png
file_src_name_body : child
file_src_name_ext : png
file_src_pathname : /tmp/phpVxcgAL
file_src_mime : text/plain
file_src_size : 36177 (max= 52428800)
file_src_error : 0
If it is buggy, you can deactivate mime_content_type by setting mime_magic to false in the init() function:
Thanks for the prompt reply.
I have 2 quetsions:
1) Could this aggect other functions such as the resize and convert?
2) Where should i set $this->mime_magic= false;
If i do that there will be no control to the file types that will be uploaded?
2. In the code, inside the init() function, line 2206 in version 0.31.
3. Other MIME type detection methods are available if your system supports them. Check the log produced by the class to see how are the files detected.