Bluehost.com Web Hosting $6.95

RE: Downloding files once

This is a discussion on RE: Downloding files once within the PHP General forums, part of the PHP Programming Forums category; This may work but i can't help thinking that this is the wrong way to go. Downloading 1GB or ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-06-2003
Boaz Yahav
 
Posts: n/a
Default RE: Downloding files once

This may work but i can't help thinking that this is the wrong way to
go.
Downloading 1GB or 2GB files via fpassthru doesn't feel right...

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.
Share your code : http://addexample.weberdev.com


-----Original Message-----
From: Manuel Lemos [mailto:mlemos@acm.org]
Sent: Wednesday, August 06, 2003 7:41 PM
To: Boaz Yahav
Cc: php-general@lists.php.net; Igal Rubinstein; Matt Wade
Subject: Re: Downloding files once


Hello,

On 08/06/2003 12:43 PM, Boaz Yahav wrote:
> I'm trying to allow users to download files from my servers. Files can


> be hundreds of MB in size and sometimes even a few GB. This is a
> closed section of the site and i would like to allow only
> members to be able to DL the files.
>
> I thought of using a download function that uses headers and
> readfile() or fread(). This way i can check who is the user and send /


> not send the file. However, this does not seem to work with
> such big files.


I think you are exceeding your PHP memory limit. I suggest that you use
fpassthru or maybe fread in many chunks of 100K and use flush() after
each chunk echo so you pass the data back to Apache instead of keeping
it in your PHP memory space.

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:35 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0