Jump to content

sejf83

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

sejf83's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am migrating an app to a new server and I'm having trouble getting the move_uploaded_file function to work on the new server. I did a print_r($_FILES) and I know the file to be uploaded is valid and is in the max_upload_size limit. However, move_uploaded_file() returns false with no error message and I can't figure out why. Here is a link to my phpinfo(); http://www.ucl.ac.uk/eastman/nutrident/check.php And here is the pertinent code... php: $destdir = 'filestore/'; $fileNameArray = explode(".",$_FILES["userfile"]["name"]); $fileBase = $fileNameArray[0]; $ext = $fileNameArray[1]; $destfile = $destdir.$fileBase.".".$ext; switch($_FILES["userfile"]["error"])   {       case 0:       if(move_uploaded_file($_FILES["userfile"]["tmp_name"], $destfile))       {         //Change the file permissions         chmod($destfile, 0755);       }       else         $_SESSION["uploadError"] = "<span>Upload error!</span>";       break;           case 1:              $_SESSION["uploadError"] = "<span>Max size exceeded. Please upload a smaller file.</span>";           break;       case 2:       case 3:         $_SESSION["uploadError"] = "<span>File Upload Incomplete! Please Try Again.</span>\n";           break;       case 4:         $_SESSION["uploadError"] = "<span>Please select a valid file.</span>\n";           break;   } $_SESSION["uploadError"] always returns "Upload Error!". Is there something wrong with my php.ini? Thanks.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.