You need to sign in to do that
Don't have an account?
Can't download Attachments from Flex. Security error.
I followed this example for downloading Attachments from Flex
http://blog.nitrogenlabs.com/2008/10/flex-getting-attachments-from.html
And I'm getting a Sandbox error.
*** Security Sandbox Violation *** Connection to https://na2.salesforce.com/servlet/servlet.FileDownload?file=MyFile halted - not permitted from https://c.na2.visual.force.com/resource/1266428442000/MyResource Error #2044: Unhandled SecurityErrorEvent:. text=Error #2048: Security sandbox violation: https://c.na2.visual.force.com/resource/1266428442000/MyResource cannot load data from https://na2.salesforce.com/servlet/servlet.FileDownload?file=MyFile. at x at x Error: Request for resource at https://na2.salesforce.com/servlet/servlet.FileDownload?file=MyFile by requestor from https://c.na2.visual.force.com/resource/1266428442000/MyResource is denied due to lack of policy file permissions.
If I grab the url of the attachment and paste it directly into the browser, I can download the file with no authentication challenge or errors.
It's a cross-domain scripting error -- your Flex app must be running in a Visualforce page. It might fix it if you alter the URL of the file such that the domain is the same, like
https://c.na2.visual.force.com/servlet/servlet.FileDownload?file=MyFile
Not sure if you can really get to it with that kind of URL but it's worth a try.
I am also facing same issue, Any solutions found yet?