Skip to main content
June 30, 2025
Solved

Failed to Load PDF document when downloading using Presigned URL

  • June 30, 2025
  • 7 replies
  • 0 views

We are trying to download documents from s3 inside the interfaces using getpresignedurlfors3 functions, we are able to download almost all other type of documents except we have identified that when we are trying to download pdf docs we are getting error- Failed to load PDF document.(PFA the screenshot).Fyi we are using chrome.
Please advise what should be the fix for the issue.
.

Best answer by rajatk9867

Yes It is Chrome browser not able to load the pdf, if the content-type is set to pdf while uploading the doc to s3, loading of doc fails in Chrome so the fix is to set the content-type= application/pdf while uploading.
Also I hope Appian add 'responsecontentdisposition' parameter to getPreSignedURLForS3 function to force the download of the documents always instead of loading the document.
Thanks

7 replies

harshas2775
July 1, 2025

This looks like the screen where a pdf file loads in browser to show the contents: even file name is there! So are you able to download the document but opening is showing this screen or you get this screen as soon as you click on the download link? 

rajatk9867AuthorAnswer
July 1, 2025

Yes It is Chrome browser not able to load the pdf, if the content-type is set to pdf while uploading the doc to s3, loading of doc fails in Chrome so the fix is to set the content-type= application/pdf while uploading.
Also I hope Appian add 'responsecontentdisposition' parameter to getPreSignedURLForS3 function to force the download of the documents always instead of loading the document.
Thanks

sarathkumr268295
July 2, 2025

Are you displaying the presigned URL as a hyperlink which on clicking displays the document in the web browser or you are using the URL to download the document?

July 3, 2025

Ideally we would want the documents to download directly instead of displaying for consistency. But chrome opens images, pdf in new tab but downloads docs like word, excel etc.

sarathkumr268295
July 3, 2025

For that you can use the presigned URL to download the document. Pass the presigned URL as base url to an integration and it will download the document.