Quantcast
Channel: Discussion Forum > Connect Data Services
Viewing all articles
Browse latest Browse all 2504

Get Remote File

$
0
0

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!  :)

Version

May 2014

Code Block


Viewing all articles
Browse latest Browse all 2504

Trending Articles