<form action="u" enctype="multipart/form-data" method="POST">
<input class="multi" maxlength="2" name="doc" type="file" />
<input type="submit" value="Upload" />
</form>
Using trickery like the jquery.MultiFile (from the link above) - i.e. sending multiple files using the same input field, what will happen is that all the files will arrive through request.POST['doc'] - i.e. you don't automatically get a list of files such as request.POST['doc'] = [FileStorage(), FileStorage()] - which would probably be exactly what you want in order to iterate through. Instead, you have to use the request.POST.getall('doc') to generate a list object containing all of the uploaded files.
Keine Kommentare:
Kommentar veröffentlichen