function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Downloading Attachment Link on Salesforce1

I am using AngularJS to build a page on Salesforce1 mobile app. I have ability for users to upload attachments which are then saved in Attachment object. On Inserting the attachment, I am populating the id of the attachment on the object. Lets call it AttachmentId__c.

Normally ill simply use the '/servlet/servlet.FileDownload?file=' link to generate attachment link.

However, on Salesforce1 this link goes nowhere, it takes the user on the chatter feed and displays error. please login to correct org. 

Is there a way to get ServerURL for Salesforce1? Any pointers appreciated.
You mean a link to download the attachment?  So the insert is fine, you have an ID but you are trying to trigger off a download?  A VF page with the right mime/content type might be the way to go.
Can you elaborate a bit?
You can set the body of the page to do nothing but output the attachment body and then set the contentType, you should have a VF page which does nothing but serve that file.