#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    16
    Rep Power
    0
    Hello,

    any help on this is most appreciated. I have created a function to download a file. It seems to work except the file sizes differ greatly. I start off downloading a 5mb .zip file and end up with a 2mb .zip file on the initiating host. Thanks for any advice on this.

    function get_http_file ($host_url, $http_file)
    {
    global $host_url, $http_file;

    $fp = fopen("$host_url/$http_file","rb");

    while(!feof($fp))
    {
    $my_file .= fgets($fp, 4096);
    }

    $fptmp = fopen("/tmp/$http_file","wb");
    fputs($fptmp,$my_file);

    fclose($fp);
    fclose($fptmp);

    if (file_exists("/tmp/$http_file"))
    {
    $result_code = 1;
    }
    else
    {
    $result_code = 0;
    }

    return $result_code;

    }//End get_promo_file()
  2. #2
  3. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    6
    Rep Power
    0
    hmm, maybe this has something to to
    with the configuration option
    of max filesize, with is defaulted to
    2mb

    ------------------
    Greetings lewi

Similar Threads

  1. Apache file server referrer restrictions ?
    By Ray@VSK in forum Apache Development
    Replies: 9
    Last Post: April 19th, 2004, 12:23 PM
  2. writing a file to a ftp server
    By buddinghere in forum FTP Help
    Replies: 1
    Last Post: February 12th, 2004, 10:36 AM
  3. Replies: 1
    Last Post: February 8th, 2004, 01:59 PM
  4. Replies: 0
    Last Post: February 7th, 2004, 05:19 AM
  5. PHP file upload script trouble
    By casbboy in forum PHP Development
    Replies: 9
    Last Post: February 5th, 2004, 07:42 PM

IMN logo majestic logo threadwatch logo seochat tools logo