hno Posted December 23, 2013 Share Posted December 23, 2013 HI I've this simple code for downloading files from a direct link and move it to my webhost . <?php ini_set('display_errors', '1'); error_reporting(E_ALL); $v = "http://highestvideo.com/up_image/01-24-58-09!1!.jpeg"; $ch = curl_init($v); $fp = fopen('aaa/flower.jpg', 'w'); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); fclose($fp); ?> I've set the permissions to 777 , It does create a file but it's 0 byte and empty . my webhost is not cpanel , it's kloxo server 6.1.2 stable . What is the problem ? How can I fix it ? thanks Link to comment https://forums.phpfreaks.com/topic/284906-problem-to-download-files-from-direct-link/ Share on other sites More sharing options...
Ch0cu3r Posted December 23, 2013 Share Posted December 23, 2013 Have you checked to make sure that the curl request is actually returning the downloaded file? Also have you asked permission from the site owner that you can download and use their content on your site? Link to comment https://forums.phpfreaks.com/topic/284906-problem-to-download-files-from-direct-link/#findComment-1463006 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.