Jump to content

File downloaded to server but error 404.jsp?


siddscool19

Recommended Posts

What does that error means?

I have downloaded the file to my server from another server using curlopt_FILE and its showing correct size...

Few files work (rarely) but most of the time when i try to access file it gives error 404.jsp and takes me to home page :(  ???

 

can u tell me how to use it please?

This is the coding which I am using to download file....

<?php
/*
This is usefull when you are downloading big files, as it
will prevent time out of the script :
*/
set_time_limit(0);
ini_set('display_errors',true);//Just in case we get some errors, let us know....
$filename=$_POST["filename"];
$file=$_POST["file"];
$fp = fopen (dirname(__FILE__) . '/'.$filename.'', 'w+');//This is the file where we save the information
$ch = curl_init($file);//Here is the file we are downloading
curl_setopt($ch, CURLOPT_TIMEOUT, 50);
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_exec($ch);
curl_close($ch);
fclose($fp);
?>

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.