Attachment URL

I have read here that using hyperlink(CONCATENATE(“[https://www.appsheet.com/template/getappfileurl?appName=",“YOURAPPNAMEANDID”,"&tableName=",“YOURTABLENAME”,"&fileName=",“Attachments%2F”,“YOURFILENAME”,".pdf")]

will generate a URL to the pdf attachment , However I have tried it but it still shows bad request error ,

after I used <<_ATTACHMENTFILE_URL>> in the attachment template it worked and gave the following URL structure :

https://www.appsheet.com/template/getappfileurl?appName=Kuwaitorders-1502280&fileName=Files%2Ftest.pdf&appVersion=1.000027&signature=2192894ecdae6fb1fc4e06ce5794cb61b6fe43443cb5f175a59c706481dc9155a5f3f3521d0b2ea0c9b3d44421fd1e65

I need to add the attachment url to a column within my table , and in order to do so I need to construct the URL with (CONCATENATE order then I still need “signature=” value where it change for each entry .

hope I could explain my problem , and if you need any other clarification please ask .

thanks in advance .

Hi mosap_ali,

Thank you for reaching out! I see in the example you share you are not encoding the parameters you want the URL to have and you are not separating the name of the hyperlink from the hyperlink itself. That could be leading to the bad request error. Give the following format a try:

HYPERLINK(CONCATENATE("[https://www.appsheet.com/template/getappfileurl?appName=",ENCODEURL("YOURAPPNAMEANDID”),"&tableName=",ENCODEURL(“YOURTABLENAME”),"&fileName=",ENCODEURL(“Attachments%2F”) ), CONCATENATE(“YOURFILENAME”,".pdf"))

Here you will find more details on hyperlinks and URL encoding.

Also, because you are manually constructing a link to display a document, that link will stop working very soon UNLESS you edit your app by going to Security -> Options and uncheck the toggle for “Require Image and File URL Signing.”

By unchecking this option, you should understand that you are making your app files less secure. An app user could potentially modify the URL in order to see any file in the app that they could guess the file name for. If the Secure Image access and/or Secure PDF access settings are disabled for the app, this means potentially anyone can do this. It is best to leave the option checked if possible.

1 Like