Reputation: 1186
There is a service for uploading large files (more than 500MB) with php/apache. The progress of upload is tracked by the uploadprogress
pecl extension.
This scheme works fine only for small file uploads.
However, there is a problem when uploading large files. Once the upload is finished, there is a standard information in the $_FILES array showing there are no errors. The problem is that the /tmp/phpXXXX file itself doesn't exist by this time.
I've tested that if we manually remove the tmp file during the upload, upload process will not stop and the error will be raised only after the upload is finished.
Hosting provider says that there are no maintenance scripts that are removing tmp files. Also it says that such tmp files are available in the filesystem almost until the end of the upload, and then they disappear.
Could it be caused by the apache/server/php configuration? Is there anything in the OS that may affect these tmp files?
OS is Ubuntu 8 LTS
Any help would be appreciated!
Upvotes: 2
Views: 551
Reputation: 4128
There is a number of reasons why uploaded files might not work.
$POST_MAX_SIZE = ini_get('post_max_size'); $unit = strtoupper(substr($POST_MAX_SIZE, -1)); $multiplier = ($unit == 'M' ? 1048576 : ($unit == 'K' ? 1024 : ($unit == 'G' ? 1073741824 : 1))); if (isset($_SERVER['CONTENT_LENGTH'])) { if ((int) $_SERVER['CONTENT_LENGTH'] > $multiplier * (int) $POST_MAX_SIZE && $POST_MAX_SIZE) { $error = 'POST exceeded maximum allowed size.'; } }
$_FILES['myfile']['error']
> 0 (see: http://php.net/manual/en/features.file-upload.errors.php)$_FILES['myfile']['name']
)move_uploaded_file
/ is_uploaded_file
returns false)!is_writable($targetDir)
Upvotes: 1
Reputation: 88796
Once the upload is finished, there is a standard information in the $_FILES array showing there are no errors.
I'm assuming you checked the error
element? It's an integer that corresponds to one of the upload error constants, such as UPLOAD_ERR_INI_SIZE
.
As I understand it, UPLOAD_ERR_NO_FILE
can also be returned if the file size goes over the PHP post_max_size
or some Apache limit (Arkh mentioned LimitRequestBody
)
Side Note: Ubuntu 10.04 LTS is out now
Upvotes: 0
Reputation: 11068
Have you verified your php upload_max_filesize and post_max_size settings? (in your php.ini file)
Upvotes: 0
Reputation: 8459
Have you checked your server LimitRequestBody parameter ? It may not be high enough for the files you're trying to upload.
Upvotes: 0