
Originally Posted by
ShinVe
[HTML]my question is how does the input type="hidden" that sets the max file size get linked with the input type="file" via plain html only.
say you have
Code:
<input type='file' name='txtUploadFileName' />
Then the value in the hidden input with name 'MAX_FILE_SIZE' is submitted with the <form> when the submit button is clicked.
The server then automatically checks if the size of the file exceeds the value of MAX_FILE_SIZE.
If it does then your $_FILES['txtUploadFileName']['error'] will equal 2.
If you have multiple file uploads in the one form then all the form's input names have to be named as arrays by appending [] to each name.
Code:
<input type='file' name='txtUploadFileName[]' />
Then loop through all the file names to be uploaded in $_FILES['txtUploadFileName']['tmp_name'] and process them individually using the same process you would use if uploading just a single file per form.
So with multiple uploads, the first file name will be in $_FILES['txtUploadFileName']['tmp_name'][0]
Bookmarks