Re: [symfony-users] File Download too big for memory

2010-09-02 Thread Jochen Daum
Hi,

if you create the file yourself, you just need to start browser output
while you are working on the file and clear the memory of any lines
you have produced.

I had the same problem, using an array to store all CSV lines, so I
count how many lines I have and if it goes over a limit, I print them
out and restart.

On Thu, Sep 2, 2010 at 7:42 PM, Gareth McCumskey  wrote:
> Hi all,
> I need some assistance in creating an action that will generate a CSV file
> on the server and then push that file for download to the end user. I have
> written the code to build the csv file and that works no problem. I have
> found plenty of stuff online about altering the response headers, etc in
> preparation for the download but they all end up loading the file to
> download into memory (using readfile()) and I would rather not do that as
> these CSV could get very very large potentially. Any tips anyone can share?
> --
> Gareth McCumskey
> http://garethmccumskey.blogspot.com
> twitter: @garethmcc
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] File Download too big for memory

2010-09-02 Thread Gareth McCumskey
I am. The problem is that all the examples I see involve setting the headers
for the response (no problem there) and then it loads the file into memory
before sending it to the end user for download.

On Thu, Sep 2, 2010 at 11:32 AM, Christopher Schnell <
christopher.schn...@mda.ch> wrote:

>  why not store the file on the servers hd (/tmp) before delivering it?
>
>
>
> Regards,
>
> Christopher.
>
>
>
>
>
> *Von:* symfony-users@googlegroups.com [mailto:
> symfony-us...@googlegroups.com] *Im Auftrag von *Gareth McCumskey
> *Gesendet:* Donnerstag, 2. September 2010 09:43
> *An:* symfony-users@googlegroups.com
> *Betreff:* [symfony-users] File Download too big for memory
>
>
>
> Hi all,
>
>
>
> I need some assistance in creating an action that will generate a CSV file
> on the server and then push that file for download to the end user. I have
> written the code to build the csv file and that works no problem. I have
> found plenty of stuff online about altering the response headers, etc in
> preparation for the download but they all end up loading the file to
> download into memory (using readfile()) and I would rather not do that as
> these CSV could get very very large potentially. Any tips anyone can share?
>
>
> --
> Gareth McCumskey
> http://garethmccumskey.blogspot.com
> twitter: @garethmcc
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>
>   --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>



-- 
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] File Download too big for memory

2010-09-02 Thread Chris Banford

 Hi Gareth ,

This example is streaming a zip file on the fly - maybe will help in 
your CSV problem?


http://pablotron.org/software/zipstream-php/

Cheers,
-Chris



Hi all,

I need some assistance in creating an action that will generate a CSV 
file on the server and then push that file for download to the end 
user. I have written the code to build the csv file and that works no 
problem. I have found plenty of stuff online about altering the 
response headers, etc in preparation for the download but they all end 
up loading the file to download into memory (using readfile()) and I 
would rather not do that as these CSV could get very very large 
potentially. Any tips anyone can share?


--
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc



--
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


AW: [symfony-users] File Download too big for memory

2010-09-02 Thread Christopher Schnell
why not store the file on the servers hd (/tmp) before delivering it?

Regards,
Christopher.


Von: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com] Im 
Auftrag von Gareth McCumskey
Gesendet: Donnerstag, 2. September 2010 09:43
An: symfony-users@googlegroups.com
Betreff: [symfony-users] File Download too big for memory

Hi all,

I need some assistance in creating an action that will generate a CSV file on 
the server and then push that file for download to the end user. I have written 
the code to build the csv file and that works no problem. I have found plenty 
of stuff online about altering the response headers, etc in preparation for the 
download but they all end up loading the file to download into memory (using 
readfile()) and I would rather not do that as these CSV could get very very 
large potentially. Any tips anyone can share?

--
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc
--
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] File Download too big for memory

2010-09-02 Thread Daniel Lohse
Off the top of my head, I'd say that you might want to take a look at the 
stream classes (or functions) in PHP. Mind you, this is just a thought, as I've 
never done anything like that. ;-)


Cheers, Daniel

Sent from my iPhone4

On Sep 2, 2010, at 9:42 AM, Gareth McCumskey  wrote:

> Hi all,
> 
> I need some assistance in creating an action that will generate a CSV file on 
> the server and then push that file for download to the end user. I have 
> written the code to build the csv file and that works no problem. I have 
> found plenty of stuff online about altering the response headers, etc in 
> preparation for the download but they all end up loading the file to download 
> into memory (using readfile()) and I would rather not do that as these CSV 
> could get very very large potentially. Any tips anyone can share?
> 
> -- 
> Gareth McCumskey
> http://garethmccumskey.blogspot.com
> twitter: @garethmcc
> -- 
> If you want to report a vulnerability issue on symfony, please send it to 
> security at symfony-project.com
>  
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] File Download too big for memory

2010-09-02 Thread Gareth McCumskey
Hi all,

I need some assistance in creating an action that will generate a CSV file
on the server and then push that file for download to the end user. I have
written the code to build the csv file and that works no problem. I have
found plenty of stuff online about altering the response headers, etc in
preparation for the download but they all end up loading the file to
download into memory (using readfile()) and I would rather not do that as
these CSV could get very very large potentially. Any tips anyone can share?

-- 
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en