directly download file from DB

Hi All,
I need to download from DB a PDF tha is stores as Base64 format
I would like to do that directly in SAIL to allow to our users to dwnload directly from the interface this document
How can I do that , is there a method ?
Thanks
Elia

  Discussion posts and replies are publicly visible

Parents
  • I have to receive many files from another system and to show them on demand , when the user need.
    If I load these files by a process, as document variable type, the risk is the process can consume a large amount of RAM
    If I have many of these instances they can slow down the whole system ...more, they stay in memory until an engines restart happens (if the instances are terminated), so a SAIL "direct download" approach if the only way I can see...
Reply
  • I have to receive many files from another system and to show them on demand , when the user need.
    If I load these files by a process, as document variable type, the risk is the process can consume a large amount of RAM
    If I have many of these instances they can slow down the whole system ...more, they stay in memory until an engines restart happens (if the instances are terminated), so a SAIL "direct download" approach if the only way I can see...
Children
  • 0
    Certified Lead Developer
    in reply to eliav
    You have to factor in how big are the documents and how frequent they are downloaded.

    Both approaches have it's advantages. If immediate/on-the-fly download is not a required, I recommend via process approach. The process can be delete/archived immediately after moving the document to Appian collab.

    Direct download takes up RAM temporarily. The way the direct download works is the servlet takes document/sql parameters and retrieve and loads base64 string to RAM (JAVA heap), convert it to document stream output.
  • 0
    Appian Employee
    in reply to eliav

    I think there's a misunderstanding here. Document variables use almost no memory, since they're just ids. Giving your users the option to download documents with a!documentDownloadLink() should not be causing any performance issues. If it is, please create a support case.