I have a question.
I have a script that handles file upload, and after the file is done uploading, I send $_FILES data over to another local script via curl, which handles the files and puts it into proper place.
The problem is, it works perfectly on my local, using following curl settings:
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST,count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
I run windows 7, but when I moved the script to my dedicated server (CentOS), it stopped working.
After doing some research, when the file is uploaded, it is stored in /tmp directory.
It turns out, the file uploaded to /tmp is deleted right before my curl call. It is known that PHP deletes tmp file uploads once the script finishes executing.
Is there a setting I could use in CURL to bypass this problem? It works fine locally, I just don't understand why it wouldn't work on my CentOS server..
UPDATE: It worked on my other server, which runs on linux as well... I don't know what particular setting it is to change this, but it seems like every server configuration is different on this.