Hi Will,
I guess "downloaded" in your question should be "uploaded"?
The moveUploadedFiles function should definitely work. Did you try debugging it? Or check at the server console if it returned any errors?
For some background, here's what's happening:
-
user selects one or more files to be uploaded to the form.
-
when the form (on an XPage) is submitted, the files are uploaded first and attached to a (1) temporary document.
-
after all uploads have been completed, the form is submitted.
-
in the postSaveDocument event of the form, a call is made to the moveUploadedFiles function that moves the files from the temporary document to the correct target document.
-
the document containing the temporary files is removed.
If you disable the docFiles.remove(true); line in the moveUploadedFiles function, the temporary document containing the file(s) isn't deleted so you can check if the files are uploaded correctly.
Mark