I have a situation where I need to move files from one location to another. Using cURL, it is simple to download the files and then upload them using the sweet at symbol i.e. “file_box”=>”@/path/to/myfile.jpg” What I’m looking to do now is bypass the saving step in the middle and just “stream” the file from one to the other. Is this possible?
Share
Sure, you can do that. I’m not sure you can use cURL for the POST though. You’d have to look into its methods to see if it will let you callback for the next chunk of data.
http://curl.haxx.se/libcurl/php/examples/callbacks.html
Now for the sending part, it seems you will have to implement HTTP yourself with
fsockopen. See here for more information: PHP How To Send Raw HTTP Packet