skip to Main Content

Due to unknown reasons since a few days my Plesk server will no longer collaborate with PHP file uploads.

Testing was done with a 1.8 MB mp3 file and an even smaller movie file.

I tried to debug my way through this issue..

upload_max_filesize = 100M

post_max_size = 128M

open_basedir is either off or set to two directories, one of them being /tmp/

upload_tmp_dir = /tmp
memory_limit = 4096M (due to other reasons this is set extra high)

/tmp comes like this:

drwxrwxrwx   4 root root  200 Mar 29 14:09 tmp

Linux version 2.6.32-5-amd64 (Debian 2.6.32-35) ([email protected]) (gcc version 4.3.5 (Debian 4.3.5-4) ) #1 SMP Tue Jun 14 09:42:28 UTC 2011

My forms use multipart/form-data, so this is settled, although i also tested with two different ajax upload scripts – both of which usually work just fine.

I get no error messages whatsoever. All i know is that the tmp file is not there after uploading. And that’s that.

Does anyone know what is going on here?

Thank You!

3

Answers


  1. I image somewhere in your code you access $_FILE array to get the uploaded file.

    try this:

     print_r($_FILES);
    

    If the problem is php related you will see “error code” set.

    Here is an error codes explanation:
    http://php.net/manual/en/features.file-upload.errors.php

    This can help you identifying the problem

    Login or Signup to reply.
  2. As stated in your comments you have a overflow mounted on top of /tmp. This behaviour actually indicates, that /tmp is full, because if /tmp is full a script /etc/init.d/mountoverflowtmp will automatically create a RAM-disk that is 1mb in size. So I suggest to umount overflow and then to clean up your /tmp

    Login or Signup to reply.
  3. “All i know is that the tmp file is not there after uploading. And
    that’s that.”

    Do you mean that you are looking for it manually after you run the script? If that is the case, that is the expected behavior. The file is temporarily stored in $_FILES[‘postVariableName’][‘tmp_name’] and will be removed at the end of the script unless you do something w/the file first.

    $localFilePath='/some/file/path.txt';
    if(move_uploaded_file($_FILES['postVariableName']['tmp_name'], $localFilePath)){
       //Successfully moved the file
    }
    else{
       //Unable to move file
       echo'Could not move file';
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search