Jump to content

Recommended Posts

hi everyone i have this problem which i cannot get the right link to download it seems encoded when i use the curl when i click on the website link to go in i can download the file can anyone slove this ? is this something to do with the useragent ?  And can i know how do i make it download manually into the serverit self ? from tube8 ?

 

please advise thanks in advanced

 

$userAgent ='# IE 6 - Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)';

$url = "http://removed/";

$ch = curl_init();    // initialize curl handle

curl_setopt($ch, CURLOPT_URL,$url); // set url to post to

curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);

curl_setopt($ch, CURLOPT_FAILONERROR, 1);

//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects

//curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable

curl_setopt($ch, CURLOPT_TIMEOUT, 3); // times out after 4s

//curl_setopt($ch, CURLOPT_POST, 1); // set POST method

//curl_setopt($ch, CURLOPT_POSTFIELDS, "url=index%3Dbooks&field-keywords=PHP+MYSQL"); // add POST fields

$result = curl_exec($ch); // run the whole process

curl_close($ch);

echo $result;

Link to comment
https://forums.phpfreaks.com/topic/168425-low-priority-help-on-curl/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.