You need to sign in to do that
Don't have an account?
asadim
Actual link to an Attachment file
Hi,
Anybody knows how to get the actual link to a file sitting inside an Attachment? Currently when you say "View this file" you go to something like:
https://na2.salesforce.com/servlet/servlet.FileDownload?file=00PA0000005EPlt
What I'm looking for is:
http://??????????/myFile.doc
Any ideas? Thanks!
In my opinion it’s not possible to get actual link(as you want) to a file, since salesforce provide an unique id for every entity you save to salesforce.And this id is used for accessing these entities.
The trick is figuring out how to generate the begining of the URL for your instance.
In the example above, getting 00PA0000005EPlt in your controller is easy.
What may be harder is figuring out the beginning -- https://na2.salesforce.com/servlet/servlet.FileDownload
This thread is old. The attachments now come off a server like -- https://c.na15.content.force.com/servlet/ -- so it would be harder to generate that from the based SF URL.