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.
$handle = new Upload($file, 'pt_BR');
$handle->allowed = array('text/pdf');
if ($handle->uploaded) {
$handle->Process(stripslashes($DirTo));
}
Log information on the upload! system information - class version : 0.28 - GD version : 2.0.34 - supported image types : png jpg gif bmp - open_basedir : no restriction - language : pt_BR 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 not availabled - Checking MIME type with mime.magic file (mime_content_type()) mime_content_type() is not available - Checking MIME type with getimagesize() getimagesize() failed - MIME type detected as application/force-download by browser source variables - You can use all these before calling process() file_src_name : LLContabil-2009-02.pdf file_src_name_body : LLContabil-2009-02 file_src_name_ext : pdf file_src_pathname : G:\Temp\php38C1.tmp file_src_mime : application/force-download file_src_size : 47427 (max= 2097152) file_src_error : 0 process file to attach/49\ - file size OK - error: Tipo de arquivo incorreto.Reply
Log information on the upload!
system information
- class version : 0.28
- GD version : 2.0.34
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- language : pt_BR
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 not availabled
- Checking MIME type with mime.magic file (mime_content_type())
mime_content_type() is not available
- Checking MIME type with getimagesize()
getimagesize() failed
- MIME type detected as application/force-download by browser
source variables
- You can use all these before calling process()
file_src_name : LLContabil-2009-02.pdf
file_src_name_body : LLContabil-2009-02
file_src_name_ext : pdf
file_src_pathname : G:\Temp\php38C1.tmp
file_src_mime : application/force-download
file_src_size : 47427 (max= 2097152)
file_src_error : 0
process file to attach/49\
- file size OK
- error: Tipo de arquivo incorreto.