Jump to content

problem to download files from direct link


hno

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.