Forum OpenACS Q&A: Multiple file upload does not work

Request notifications

Posted by Tony Kirkham on
I am attempting to upload multiple files, via the HTML5 multiple attribute, and it is not working. I am using Naviserver/4.99.8 (as reported in the response header).

Via various combinations of ad_page_contract var:multiple, ad_form ... file(file),multiple, and the form/query get calls I find that I do see the multiple file names that were submitted, but the file_entry.tmpfile only contains one file. (I can also see in the post that multiple files are being sent.)

The naviserver documentation states:
ns_conn fileheaders file
Return the ns_set with header information for the uploaded file with the specified name (returned via [ns_conn files]). If the file was uploaded with the HTML5 multiple attribute a list of ns_sets is returned.

However, this also only returns one ns_set reference that contains the information about one of the files.

An ugly solution to this is that via JavaScript I could assign each file a different "indexed" name and then construct these indexed names on the server side, but that is just not the elegant solution that this could be.

How do I get this to work? Am I doing something wrong or is this functionality not yet implemented?


Posted by Gustaf Neumann on
Dear Tony,

NaviServer supports the HTML5 multiple file upload feature since version 4.99.11 (see [1], released Mai 2016). You are probably reading the documentation of NaviServer 4.99.13.

all the best