My php curl upload script runs successfully on localhost but not on sever..
The curl is working fine for simple post but not for posting files. As soon as i start adding file to my post data ( prefixing file path with @ ), its showing nothing on server ($_FILE & $_POST both is found unset) while without the file, the $_POST is populated .
I am using following script on my localhost and server too.

I have changed the request_url to the curl_upload_process.php file on the server.
Its working fine on localhost for both simple post and file upload but not on server for only the file upload. Please let me know whats causing the problem to my script on the server.

@likai yes the curl is enabled on my server. and as i said its working for simple post but not file upload. if is send $post_params['name'] = 'Anup'; it reaches to the server successfully.
–
Anup_TripathiJan 25 '13 at 6:56

@user801662 I have tried your code, It is working. :(
–
KaiJan 25 '13 at 7:38

@likai is it really working on your remote server? if yes, there might be something missing on my server. plz confirm if its uploading/sending file from the client computer to a/your remote server ?
–
Anup_TripathiJan 25 '13 at 7:43

2 Answers
2

hi after much digging i found that you can use the scp command which uses the SSH (Secure SHell) protocol and php have library to use that with in the php code but you need to have the server allowing scp connention

I can simply say that your answer must work (for another cases) but i just do not want to browse the file. I have only the paths of files on my machine and i want to upload these files by their paths only. No Browse.
–
Anup_TripathiJan 25 '13 at 6:45