Note that there are some explanatory texts on larger screens.

plurals
  1. POphp multiple file upload oddity
    primarykey
    data
    text
    <p>[SOLVED] dont ask me how i have no idea, i didnt change anything but the names of the 2 form file inputs from uploadedfile and fuploadedfile to abc and abc2 and now it works, im as confused as you.</p> <p>ok, i have 2 file inputs one called 'uploadedfile' the other called 'fuploadedfile' i have a function i call to upload a file, which if tested on a single file works</p> <pre><code>uploadfile($_FILES["uploadedfile"]); </code></pre> <p>works</p> <pre><code>uploadfile($_FILES["fuploadedfile"]); </code></pre> <p>does not</p> <p>i have tacked this to the end of the upload script to see what happens</p> <pre><code>echo var_dump($_FILES["uploadedfile"]); echo var_dump($_FILES["fuploadedfile"]); </code></pre> <p>EDIT: this is what i get from each uploadedfile:</p> <pre><code>array(5) { ["name"]=&gt; string(7) "cat.gif" ["type"]=&gt; string(9) "image/gif" ["tmp_name"]=&gt; string(24) "C:\xampp\tmp\php59F9.tmp" ["error"]=&gt; int(0) ["size"]=&gt; int(14328) } </code></pre> <p>and this is what i get from fuploadedfile:</p> <pre><code>NULL </code></pre> <p>the first one prints out an array full of information relative to the uploaded file, which is good. the second one gives me some "Undefined index" error, im uploading the same file via the same script, the only thing thats different is that ive called the second one a different name which shouldnt effect the upload script because it uses a dynamic variable.</p> <p>here's the upload script - <a href="http://pastebin.com/vkcZEmXp" rel="nofollow">http://pastebin.com/vkcZEmXp</a></p> <p>Why is it doing this?</p> <p>EDIT: this is pretty much the HTML form (sans the other random inputs), but i don't think it's the problem because the upload has worked for the first one.</p> <pre><code>&lt;form name="mainform" id="mainform" enctype="multipart/form-data" action="uploader.php" method="POST"&gt; &lt;input name="uploadedfile" type="file" /&gt; &lt;input name="fuploadedfile" type="file" /&gt; &lt;input class="formbtn" type="submit" value="Submit"&gt; &lt;/form&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.
 

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