Yassine Qoraiche
Yassine Qoraiche

Reputation: 31

PHP Curl Upload Image and Get Image Uploaded Url

Im new in PHP Curl Library , So i don't have alot of experience ,

i have website of funny pics and im tired of uploading images to hostingpics.net and get url then put it in my website , i think there is option in curl upload file to another remote server , ang get link with DOM or something like that !

here is the site to upload image : here

thanks,

Upvotes: 0

Views: 678

Answers (1)

imbondbaby
imbondbaby

Reputation: 6411

This topic answers your question

As suggested, you could try this:

$ch = curl_init("http://www.remotepage.com/upload.php"); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CUROPT_POSTFIELDS, array('fileupload' => '@'.$_FILES['theFile'] ['tmp_name'])); 
echo curl_exec($ch);

Here is the catch, your website is quite big and complicated. A simple snippet like this won't help you much other than getting an idea about the file upload. You will need to pass your parameters along with the upload like username, password etc.

Upvotes: 2

Related Questions