Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't find uploaded files in temp directory after script execution ends
    primarykey
    data
    text
    <p>I am trying out a tutorial on W3 schools to learn how to create forms for PHP uploads.</p> <p>To this end, I have the following two files as shown on <a href="http://www.w3schools.com/php/php_file_upload.asp" rel="nofollow">W3 schools</a>:</p> <p>The HTML file:</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;form action="upload_file.php" method="post" enctype="multipart/form-data"&gt; &lt;label for="file"&gt;Filename:&lt;/label&gt; &lt;input type="file" name="file" id="file" /&gt; &lt;br /&gt; &lt;input type="submit" name="submit" value="Submit" /&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>and the corresponding PHP file as follows:</p> <pre><code>&lt;?php if ($_FILES["file"]["error"] &gt; 0) { echo "Error: " . $_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;"; echo "Stored in: " . $_FILES["file"]["tmp_name"]; } ?&gt; </code></pre> <p>When I save the above files onto my localhost, and execute the up.html file, the PHP produces an output as follows:</p> <blockquote> <p>Upload: AddTrustExternalCARoot.crt<br> Type: application/x-x509-ca-cert<br> Size: 1.4853515625 Kb<br> Stored in: /tmp/phpK0YqyL </p> </blockquote> <p>Unfortunately, I cannot seem to find this <code>/tmp/phpK0YqyL</code>.</p> <p>Can anyone suggest where this file could possibly be located?</p> <p>In reality, I would also like to know how one could specify the path to directly upload the file to (presumably this would be somewhere in <code>$_FILES</code> array).</p>
    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.
 

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