Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy won't my file upload with my PHP upload script?
    primarykey
    data
    text
    <p>First I asked this question here: <a href="https://stackoverflow.com/questions/19921070/how-do-i-change-the-file-name-before-sending-to-upload-file-php">How do I change the file name before sending to upload_file.php?</a></p> <p>I updated my upload_file.php script with the suggestion, but when I run it, it doesn't work. Using the form from the above link, when I go to upload the script, the echo's seem correct, but when I FTP to the directory the file is supposed to be, the directory is empty? Could someone shine some light on this? I want the file to be uploaded to '/var/www/eedis/fax/uploads/'.</p> <p>My upload_file.php script looks like this...</p> <pre><code>&lt;?php $allowedExts = array("pdf"); $temp = explode(".", $_FILES["file"]["name"]); $extension = end($temp); if ($_FILES["file"]["type"] == "application/pdf") #&amp;&amp; ($_FILES["file"]["size"] &lt; 20000) #&amp;&amp; in_array($extension, $allowedExts)) { if ($_FILES["file"]["error"] &gt; 0) { echo "Return Code: " . $_FILES["file"]["error"] . "&lt;br&gt;"; } else { echo "Upload: " . $_FILES["file"]["name"] . "&lt;br&gt;"; echo "Type: " . $_FILES["file"]["type"] . "&lt;br&gt;"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB&lt;br&gt;"; if (file_exists("upload/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "/var/www/eedis/fax/uploads/" . $_POST['number'] . '.pdf'); } } } else { echo "Invalid file"; } ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload