help in uploading a file to the server
Posted: Thu Sep 21, 2006 8:44 am
Hi people
I have the following 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
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>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