Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

uploading files not given a temp name

I have a PHP script that handles uploaded files. It's typically working fine, but I'm occasionally getting upload errors. when I check the $_FILES array, this is what I can see:

File that has failed:

Array ( [Filedata] => Array (
      [name] => cbj2_web.pdf 
      [type] => 
      [tmp_name] => 
      [error] => 1 
      [size] => 0 ) )

File that has worked:

Array ( [Filedata] => Array ( 
        [name] => tick.png 
        [type] => application/octet-stream 
        [tmp_name] => /tmp/phpL8oYLc 
        [error] => 0 
        [size] => 1108 ) )

I'm not sure what's going wrong or how to even pinpoint it. This is the at the first step of processing the file, so I don't have any code that's doing anything with the file.

Any suggestions?

like image 609
TH1981 Avatar asked Jun 07 '12 20:06

TH1981


2 Answers

From http://php.net/manual/en/features.file-upload.errors.php:

Value: 1; The uploaded file exceeds the upload_max_filesize directive in php.ini.

So you need to edit your php.ini file to increase the upload_max_filesize value to a higher value.

like image 193
Tim Fountain Avatar answered Nov 12 '22 18:11

Tim Fountain


You're getting an error of 1. This is UPLOAD_ERR_INI_SIZE.

From http://php.net/manual/en/features.file-upload.errors.php:

The uploaded file exceeds the upload_max_filesize directive in php.ini.

like image 45
Rocket Hazmat Avatar answered Nov 12 '22 19:11

Rocket Hazmat