diff options
author | Frederick Muriuki Muriithi | 2025-01-21 11:07:48 -0600 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2025-01-21 11:07:48 -0600 |
commit | 644c15452fff9769bbd3b1e6723fe6c40cd1bfc9 (patch) | |
tree | 9c20b6f11c1a2ee9395d4c71daec338e708952a2 /uploader | |
parent | a6bde3779393681351c0e806fc60be4e76c2033e (diff) | |
download | gn-uploader-644c15452fff9769bbd3b1e6723fe6c40cd1bfc9.tar.gz |
Assign returned names to file-input names
When using the chunked upload process, the final file names are
returned as part of the response indicating successful upload of all
the chunks and the merging of the chunks into a single file.
The name of the final uploaded file is used in place of the file
object that would otherwise have been uploaded.
Diffstat (limited to 'uploader')
-rw-r--r-- | uploader/templates/phenotypes/add-phenotypes-raw-files.html | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/uploader/templates/phenotypes/add-phenotypes-raw-files.html b/uploader/templates/phenotypes/add-phenotypes-raw-files.html index 9eef50d..b799da7 100644 --- a/uploader/templates/phenotypes/add-phenotypes-raw-files.html +++ b/uploader/templates/phenotypes/add-phenotypes-raw-files.html @@ -564,6 +564,16 @@ }; }; + var processForm = (form) => { + var formdata = new FormData(form); + uploaded_files.forEach((msg) => { + formdata.delete(msg["file-input-name"]); + formdata.append(msg["file-input-name"], msg["uploaded-file"]); + }); + formdata.append("resumable-upload", "true"); + return formdata; + } + var uploaded_files = new Set(); var submitForm = (new_file) => { uploaded_files.add(new_file); |