SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast ScubaDvr2's Avatar
    Join Date
    Jun 2006
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    readfile() stopping abruptly

    Hey guys,

    I seem to have a problem.
    I am attempting to download files from a php page using the readfile() function but anytime a file that is larger than 8MB attempts to get downloaded it stops at exactly 7.74238 MB. It doesn't matter what the file is, even though on the download page it displays the correct size of the file being downloaded.

    Is there something wrong with what I'm doing? here's my code:

    PHP Code:
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Content-disposition: attachment; filename=' $row['file_name'] . "\n");
    header('Content-Type: application/octet-stream');
    header('Content-length: ' filesize($row['file_disk_location']));

    readfile($row['file_disk_location']); 
    Thanks for the help

  2. #2
    SitePoint Wizard wheeler's Avatar
    Join Date
    Mar 2006
    Location
    Gold Coast, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this could be related to a server setting only giving php 8mb of memory? just a guess
    Studiotime - Time Management for Web Developers
    to-do's, messages, invoicing, reporting - 30 day free trial!
    Thomas Multimedia Web Development


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •