Skip to main content
saurabhs0003
May 31, 2021
Question

Regarding File Upload Control

  • May 31, 2021
  • 19 replies
  • 0 views

Hi All , 

In File Upload Control , I don not want to save the File in Knowledge Center Folder  when User First Upload and then Click Cancel or Close the Tab . What should I do in this case .

    19 replies

    stefanhelzle0001
    Brainy
    May 31, 2021

    The file is persisted when the user clicks a submit enabled button. An option might be to clear the rule input which stores the document on clicking the submit button.

    mikes0011
    Brainy
    June 1, 2021
    An option might be to clear the rule input which stores the document on clicking the submit button.

    nope.  it will prevent the document ID from being passed into the process, but will not prevent the document from landing in the target folder.  the only viable methods I've found to handle this are to either disable the "cancel" button, or to have the SAIL form track "newly uploaded" document IDs and pass them into an "orphaned doc IDs" list when Cancel is clicked, then have a special flow in the process to delete orphaned documents.

    Edit: of course I replied before reading the rest of the thread.  Did your tests eventually bear this out?  In the (not very distant) past I've tested this extensively, but maybe not within the previous 2 or 3 Appian versions, in case anything's changed.

    June 1, 2021

    The recent I tested is 21.1 and it's same behavior. 

    May 31, 2021
    Click Cancel

    If the Cancel button is submit=true, the document still gets uploaded even if you null the documents variable. One way to tackle it is to delete the uploaded documents in process when the user clicks cancel.

    Close the Tab

    This shouldn't upload the document, unless if you have something like wizard style form etc. In those cases you can delete these stale docs and terminate the process on a timer.

    stefanhelzle0001
    Brainy
    May 31, 2021

    Just did a test. If you null documents, no document will be created in your target folder. The temporary document uploaded while you are on the form, will be taken care of by Appian.

    May 31, 2021

    That's interesting, I tested on 21.1 and it still uploaded the document to my target folder when I hit cancel.

    [mention:126a676c85024855948336691b0a7b92:e9ed411860ed4f2ba0265705b8793d05] Please can you share how you setting the variable to null.

    June 28, 2022

    It can be done using process model instead of handling it in cancel button. 

    In the process model add a "Delete Document" node and include the logic in XOR node to route the control to "Delete document" node when user click on cancel.