File too big

See all posts Reply

File too big new!
by Wilfried, 14 years, 8 months ago
I've just tried the class but I always get an error telling me my file is too big.
Regardless the file_max_size I set. Even with a 1Kb file I don't get pass the size check.
What is the problem ?Reply
Re: File too big new!
by colin, 14 years, 8 months ago
Copy here the logs produced by the class.Reply
Re: File too big new!
by Wilfried, 14 years, 8 months ago
Where can I find those? Sorry but i'm fairly new to this Php stuff.Reply
Re: File too big new!
by colin, 14 years, 8 months ago
Output $handle->log at the end of your script.Reply
Re: File too big new!
by Wilfried, 14 years, 8 months ago
system information
- class version : 0.28
- GD version : 2.0.28
- supported image types : png jpg gif bmp
- open_basedir : /var/www/vhosts/vriens.be/subdomains/cafeminerva/httpdocs:/tmp
- language : nl_NL
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 by mime_content_type()
- Checking MIME type with getimagesize()
getimagesize() failed
- MIME type detected as Array by browser
- Try to guess MIME type from file extension (): MIME type set to Array
- MIME type couldn't be detected! (Array)
source variables
- You can use all these before calling process()
file_src_name : Array
file_src_name_body : Array
file_src_name_ext :
file_src_pathname : Array
file_src_mime : Array
file_src_size : Array (max= 2097152)
file_src_error : Array
process file to /fotos/stamgasten/
- error: Het bestand is te groot.
Reply
Re: File too big new!
by colin, 14 years, 8 months ago
Are you uploading several files at the same time?

Can you add this at the start of your script:
print_r($_FILES, 1);

And then copy here what it says.Reply
Re: File too big new!
by Wilfried, 14 years, 8 months ago
No I'm uploading only one file at the time.
When I add the code you provided it doesn't show anything.Reply
Re: File too big new!
by colin, 14 years, 8 months ago
I think there may be a problem in your PHP setup. You should have something in $_FILES. See this page for more information.Reply
Re: File too big new!
by Wilfried, 14 years, 8 months ago
When I change the command to print_r($FILES['foto']);
I get the following output:
Array ( 
  [name] => Array ( [0] => wilfried.gif ) 
  [type] => Array ( [0] => image/gif ) 
  [tmp_name] => Array ( [0] => /tmp/php5vnwGX ) 
  [error] => Array ( [0] => 0 ) 
  [size] => Array ( [0] => 18806 ) 
)

system information
- class version : 0.28
- GD version : 2.0.28
- supported image types : png jpg gif bmp
- open_basedir : /var/www/vhosts/vriens.be/subdomains/cafeminerva/httpdocs:/tmp
- language : nl_NL
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 by mime_content_type()
- Checking MIME type with getimagesize()
getimagesize() failed
- MIME type detected as Array by browser
- Try to guess MIME type from file extension (): MIME type set to Array
- MIME type couldn't be detected! (Array)
source variables
- You can use all these before calling process()
file_src_name : Array
file_src_name_body : Array
file_src_name_ext :
file_src_pathname : Array
file_src_mime : Array
file_src_size : Array (max= 2097152)
file_src_error : Array
process file to /fotos/stamgasten/
- error: Het bestand is te groot.
Reply
Re: File too big new!
by colin, 14 years, 8 months ago
Your upload file in your form is multiple. That's why you have an array for each one of your values in the $_FILES array.

See the section called What about multiple uploads in the FAQ.Reply
Re: File too big new!
by Wilfried, 14 years, 8 months ago
Hello Colin,
I think i've managed to get a bit further by implementig the code you provide in the Q&A about the multiple uploads.

But now I get an error telling me this :
system information
- class version : 0.28
- GD version : 2.0.28
- supported image types : png jpg gif bmp
- open_basedir : /var/www/vhosts/vriens.be/subdomains/cafeminerva/httpdocs:/tmp
- language :
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 by mime_content_type()
- Checking MIME type with getimagesize()
getimagesize() failed
- MIME type detected as by browser
- Try to guess MIME type from file extension (gif): MIME type set to image/gif
- can't retrieve image information. open_basedir restriction in place?
source variables
- You can use all these before calling process()
file_src_name : wilfried.gif
file_src_name_body : wilfried
file_src_name_ext : gif
file_src_pathname :
file_src_mime : image/gif
file_src_size : (max= 2097152)
file_src_error :
- source file is an image
image_src_x :
image_src_y :
image_src_pixels :
image_src_type : gif
image_src_bits :
process file to ../fotos/stamgasten/
- file size OK
- file mime OK : image/gif
- no image properties available, can't enforce dimension checks : image/gif
- file name safe format
- destination variables
file_dst_path : ../fotos/stamgasten/
file_dst_name_body : wilfried
file_dst_name_ext : gif
- no image operation, keep extension
- checking for auto_rename
- destination file details
file_dst_name : wilfried.gif
file_dst_pathname : ../fotos/stamgasten/wilfried.gif
- wilfried.gif doesn't exist already
- attempting to use a temp file: failed
- error: Can't create the temporary file. Can't carry on a process.
Reply
Re: File too big new!
by colin, 14 years, 8 months ago
Check the permissions on your destination directory and webspace. Besides, you have problems in the libraries installed to detect MIME types.Reply