For the following code mentioned here :
<div>
<label for="file">Choose file to upload</label>
<input type="file" id="file" name="file" multiple>
</div>
Is it mandatory to have the name parameter which is file
same as the id
parameter? I am sure that for
and id
values need to be same, but I am wondering if the following is possible?
<div>
<label for="file">Choose file to upload</label>
<input type="file" id="file" name="firstFile" multiple>
</div>
Is firstFile
allowed if I have to use that in Javascript something like this :
formData.append('firstFile', $('input[type=file]')[0].files[0]);