• Files Not Uploading

    By Will Parsons 9 years ago

    I'm on 8.5.1, and am trying to get this to work. When I select a file and hist the Save button, it appears that the file is being downloaded, but the file is not getting attached to the document. It's almost as though the moveUploadedFiles(currentDocument, "Notes"); command is not working correctly. Any suggestion on what to look at?

    • Internet Site doc

      By Rob Porter 9 years ago

      Hi Will

      Did you create an Internet Site document on your server per the instructions? i.e. The "save" action in uploaded files only works if you create an Internet Site rule that adds a "Content-disposition: attachment" header for a */downloads/* wildcard path.

      You may need to restart the http task after adding the internet site doc.

    • Re: attaching files

      By Mark Leusink 9 years ago

      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.


      • File list is cleared when switching tabs

        By Roy X Rumaner 9 years ago

        I have added the control to a tabbed table. When I add files using the control everything looks fine until I switch tabs. When I return to the tab with the control, the file list is empty. Does this mean that the files are no longer in the queue to be uploaded or is it something else that is clearing the list and the files are still in the queue? 

        • File uploader in a tabbed table

          By Mark Leusink 9 years ago

          Hello Roy,

          It probably depends on how the tabbed table is implemted.

          If it's done clientside then I see no problem: the selected files should remain in the list, because they're stored in JavaScript variables.

          If the tabbed tables are implemented server side (when switching tabs a server call is made to retrieve the contents of the active tab) the list will be cleared when you switch tabs. The list of files to be uploaded is only stored in (clientside) JavaScript variables, which will be cleared when the page is refreshed.