Page 1 of 1

help in uploading a file to the server

Posted: Thu Sep 21, 2006 8:44 am
by jasongr
Hi people

I have the following form:

Code: Select all

<form name="formname" method="post" action="test.php" enctype="multipart/form-data">
<input name="mode" id="mode" type="hidden"></input>
<input id="file" name="file" type="file" size="50" accept="image/*"></input>
</form>
When I submit this form to my test.php page

I iterate over $_POST to see verify that I got all the parameters.
For some reason the 'file' parameter was not sent to the server

However, if I change the enctype of the form to: multipart/mixed
Then the 'file' parameter does indeed get sent to the server, however I cannot find it in the $_FILES
array. I do find it in the $_POST array. It is as if it is not treated as a file input parameter

any suggestions?
All the reading that I have done so far lead me to believe that the value of encype should be multipart/form-data

thanks in advance

Posted: Thu Sep 21, 2006 3:57 pm
by feyd
when sending files $_POST will not have the file field, it will be in $_FILES.