File downloaded to server but error 404.jsp?

Discussion in 'PHP' started by siddscool19, Oct 9, 2008.

  1. #1
    <?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);
    ?>
    Code (markup):
    I am using this coding to download the file... It does downloads the file.. The smaller files are perfectly downloaded but the bigger files like of 100mb it does download but their link doesn't work it shows them as they doesn't exist..........
    Any way to fix it?
    I am testing on free hosting site
     
    siddscool19, Oct 9, 2008 IP
  2. Sillysoft

    Sillysoft Active Member

    Messages:
    177
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #2
    It could be restrictions of your free hosting account. I know the free one I used to do wouldnt allow me to take up that much bandwidth
     
    Sillysoft, Oct 9, 2008 IP