Topic by Justin
Content
I am attempting to get the content of a remote file (by URL) in a custom model, base64 encode it, and add it to the FileAttachmentArray for my custom object, but I am unable to do so for a few reasons.
When I attempt to download the remote file via fopen, I get an error that it is not allowed because:
- open_basedir restriction in effect. File() is not within the allowed path(s)
When I attempt to download via cURL, I get an error that
- File specified could not be found: /tmp/cmVzdWx0
The test URL I am attempting to get to is:
- http://fc04.deviantart.net/fs71/f/2010/227/4/6/PNG_Test_by_Destron23.png
I also have an issue that cURL wont allow me to set CURLOPT_FOLLOWLOCATION = true which will cause an issue because the URLs that are being sent to me are shortened, so every URL will have a redirect.
Has anyone ever been able to successfully grab an external file? If so, how did you do it? Bonus points if you got around the redirect problem! :)