Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Senior Member joncom11's Avatar
    Join Date
    Oct 2003
    Posts
    284
    Member #
    3532
    I have the following download script:

    Code:
    <?php
    Header ( "Content-Type: application/octet-stream"); 
    Header( "Content-Disposition: attachment; filename=$saveas"); 
    readfile($download);
    ?>
    where $download is the full url of the file
    and $saveas is the name of the file...

    however when I try to download anything, it saves the as _____.zip like it should, but the filesize is only a few bytes, when it should be many MB. And if you open the .zip in notepage you get the following error:

    <br />
    <b>Warning</b>: readfile() [<a href='http://www.php.net/function.readfile'>function.readfile</a>]: php_network_getaddresses: gethostbyname failed in <b>home\www\html\read.php</b> on line <b>4</b><br />
    <br />
    <b>Warning</b>: readfile(http://thedomain.com/myfilesfordownload/theziptodownload.zip) [<a href='http://www.php.net/function.readfile'>function.readfile</a>]: failed to create stream: Invalid argument in <b>home\www\html\read.php</b> on line <b>4</b><br />

    What does this mean.. what is wrong...
    Pixel Fuse - Signature webpage, just a spashpage.
    Flash Frogger - Frogger remake, animated/coded in Flash (incomplete/discontinued)
    Daase Art Studio - Homepage of David Daase, a Canadian landscape artist - image gallery/showcase.
    More links if I think of some...

  2.  

  3. #2
    WDF Staff Wired's Avatar
    Join Date
    Apr 2003
    Posts
    7,665
    Member #
    1234
    Liked
    141 times
    Not completely sure, but I do know that the PHP.ini file has a setting for the max file size for uploads.
    The Rules
    Was another WDF member's post helpful? Click the like button below the post.

    Admin at houseofhelp.com

  4. #3
    Senior Member joncom11's Avatar
    Join Date
    Oct 2003
    Posts
    284
    Member #
    3532
    Ok this is just weird... I host the same file on 3 servers.... it only works on one of them.... thing is, the server that is DID run on was from a hosting plan... and another one that the script DIDN"T work on was from another hosting plan... say are the same plans... same features...
    Pixel Fuse - Signature webpage, just a spashpage.
    Flash Frogger - Frogger remake, animated/coded in Flash (incomplete/discontinued)
    Daase Art Studio - Homepage of David Daase, a Canadian landscape artist - image gallery/showcase.
    More links if I think of some...


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 07:12 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com