Friday 15 June 2012

PHP CURL image upload to remote System -



PHP CURL image upload to remote System -

i using next code

$ch = curl_init("http://198.155.239.118/~bulacs/ssapi-staging/images/upload_images"); curl_setopt($ch, curlopt_useragent, "mozilla/5.0 (x11; linux x86_64; rv:21.0)gecko/20100101 firefox/21.0"); curl_setopt($ch, curlopt_post, true); curl_setopt( $ch, curlopt_postfields, array( 'image' => '@' . $_files['image']['tmp_name'] . ';filename=' . $_files['image']['name'] . ';type=' . $_files['image']['type'] )); curl_setopt($ch, curlopt_returntransfer, true); var_dump(curl_exec($ch));

here there no error , showing success message file not moving destination.

curl_setopt($ch, curlopt_post, 1); curl_setopt($ch, curlopt_postfields, array( 'image' => '@' . $_files['image']['tmp_name'] ));

i did , set tmp_name, above. should work.

php curl

No comments:

Post a Comment