Forum Discussion

  • vmalla There is no direct way to download the attachments like upload API. But yes, you can get it done with download.js and ajax service. You need to use the below API to get the attachment URL and then need to pass the URL in ajax.

    SELECT * FROM attachments WHERE message.id = '1057' 

    Include download.js and run the below script. Just need to pass the attachment URL dynamically.

    For reference: http://danml.com/download.html

     jQuery.ajax({ url: "https://lithiumstage.mycommunity.com/mycommunity/attachments/mycommunity/Resources/4/1/SSPL%20-%20EC%20Position%20Management%20-%20Process%20Diagrams.pdf
    ", success: download.bind(true, "text/pdf", "attchement.pdf") });