Re: [PHP] More on "JS alert that links to file"

2009-07-27 Thread tony mount
Thanks very much to all the he's and any she's who answered this.
Tony


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] More on "JS alert that links to file"

2009-07-27 Thread Ashley Sheridan
On Mon, 2009-07-27 at 07:43 -0700, Jim Lucas wrote:
> Ashley Sheridan wrote:
> > On Mon, 2009-07-27 at 07:34 -0700, Jim Lucas wrote:
> >> tony mount wrote:
> >>> I have a question that follows on from this discussion. I have a loop
> >>> which creates a number of files. It first write each file to a server
> >>> location then sets up the headers and asks the "Save As" question. This
> >>> works OK once, but after the first download it exits without any errors
> >>> or messages. If I remove the header() lines (ie just create the files on
> >>> the server) no worries, it creates them all. (I start op buffer at the
> >>> top of the code and flush the buffer on each loop). Anyone have any
> >>> ideas please?
> >>> Thanks
> >>> Tony 
> >>>
> >>>
> >> Tony,
> >>
> >> Ashley's answer is correct.  But the one thing she didn't is that what
> >> you are doing is NOT possible.
> >>
> >> You can only send your set of header()s once, then all content that
> >> follows until an exit, die, or end of script happens.
> >>
> >>
> >>
> > For the record, I'm still a he ;)
> > 
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> > 
> 
> opps, my apologies!
> 

Handbags at dawn!

Thanks,
Ash
http://www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] More on "JS alert that links to file"

2009-07-27 Thread Jim Lucas
Ashley Sheridan wrote:
> On Mon, 2009-07-27 at 07:34 -0700, Jim Lucas wrote:
>> tony mount wrote:
>>> I have a question that follows on from this discussion. I have a loop
>>> which creates a number of files. It first write each file to a server
>>> location then sets up the headers and asks the "Save As" question. This
>>> works OK once, but after the first download it exits without any errors
>>> or messages. If I remove the header() lines (ie just create the files on
>>> the server) no worries, it creates them all. (I start op buffer at the
>>> top of the code and flush the buffer on each loop). Anyone have any
>>> ideas please?
>>> Thanks
>>> Tony 
>>>
>>>
>> Tony,
>>
>> Ashley's answer is correct.  But the one thing she didn't is that what
>> you are doing is NOT possible.
>>
>> You can only send your set of header()s once, then all content that
>> follows until an exit, die, or end of script happens.
>>
>>
>>
> For the record, I'm still a he ;)
> 
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
> 

opps, my apologies!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] More on "JS alert that links to file"

2009-07-27 Thread Andrew Ballard
On Mon, Jul 27, 2009 at 10:34 AM, Jim Lucas wrote:
> Ashley's answer is correct.  But the one thing she ...

He.

Andrew

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] More on "JS alert that links to file"

2009-07-27 Thread Ashley Sheridan
On Mon, 2009-07-27 at 07:34 -0700, Jim Lucas wrote:
> tony mount wrote:
> > I have a question that follows on from this discussion. I have a loop
> > which creates a number of files. It first write each file to a server
> > location then sets up the headers and asks the "Save As" question. This
> > works OK once, but after the first download it exits without any errors
> > or messages. If I remove the header() lines (ie just create the files on
> > the server) no worries, it creates them all. (I start op buffer at the
> > top of the code and flush the buffer on each loop). Anyone have any
> > ideas please?
> > Thanks
> > Tony 
> > 
> > 
> 
> Tony,
> 
> Ashley's answer is correct.  But the one thing she didn't is that what
> you are doing is NOT possible.
> 
> You can only send your set of header()s once, then all content that
> follows until an exit, die, or end of script happens.
> 
> 
> 
For the record, I'm still a he ;)

Thanks,
Ash
http://www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] More on "JS alert that links to file"

2009-07-27 Thread Ashley Sheridan
On Mon, 2009-07-27 at 10:30 -0400, kyle.smith wrote:
> You really can't send multiple files in a single response, and you certainly 
> can't send multiple headers after data has gone through.
> 
> Zipping would be a nice approach.  Another would be to use AJAX calls to 
> sequenctially download the files.
> 
> HTH,
> - Kyle
> 
> 
> -Original Message-
> From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk]
> Sent: Mon 7/27/2009 8:30 AM
> To: tony mount
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] More on "JS alert that links to file"
>  
> I assume you want to force the files to the user as a series of files to
> download? Have you considered just offering a page of links to each
> file? You can actually have the links go to a PHP script which can
> stream the file as a forced download, and the user can then download the
> files one-by-one by clicking the link as if it were a normal link.
> Alternatively, you could zip the files up into one archive using PHP and
> offer stream that file down to the user.
> 
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
> 
> On Mon, 2009-07-27 at 21:54 +0930, tony mount wrote:
> > I have a question that follows on from this discussion. I have a loop
> > which creates a number of files. It first write each file to a server
> > location then sets up the headers and asks the "Save As" question. This
> > works OK once, but after the first download it exits without any errors
> > or messages. If I remove the header() lines (ie just create the files on
> > the server) no worries, it creates them all. (I start op buffer at the
> > top of the code and flush the buffer on each loop). Anyone have any
> > ideas please?
> > Thanks
> > Tony 
> > 
> > 
> 
> 

That's why I suggested offering a page of links rather than whatever he
was trying before.

Thanks,
Ash
http://www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] More on "JS alert that links to file"

2009-07-27 Thread Jim Lucas
tony mount wrote:
> I have a question that follows on from this discussion. I have a loop
> which creates a number of files. It first write each file to a server
> location then sets up the headers and asks the "Save As" question. This
> works OK once, but after the first download it exits without any errors
> or messages. If I remove the header() lines (ie just create the files on
> the server) no worries, it creates them all. (I start op buffer at the
> top of the code and flush the buffer on each loop). Anyone have any
> ideas please?
> Thanks
> Tony 
> 
> 

Tony,

Ashley's answer is correct.  But the one thing she didn't is that what
you are doing is NOT possible.

You can only send your set of header()s once, then all content that
follows until an exit, die, or end of script happens.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] More on "JS alert that links to file"

2009-07-27 Thread kyle.smith
You really can't send multiple files in a single response, and you certainly 
can't send multiple headers after data has gone through.

Zipping would be a nice approach.  Another would be to use AJAX calls to 
sequenctially download the files.

HTH,
- Kyle


-Original Message-
From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk]
Sent: Mon 7/27/2009 8:30 AM
To: tony mount
Cc: php-general@lists.php.net
Subject: Re: [PHP] More on "JS alert that links to file"
 
I assume you want to force the files to the user as a series of files to
download? Have you considered just offering a page of links to each
file? You can actually have the links go to a PHP script which can
stream the file as a forced download, and the user can then download the
files one-by-one by clicking the link as if it were a normal link.
Alternatively, you could zip the files up into one archive using PHP and
offer stream that file down to the user.

Thanks,
Ash
http://www.ashleysheridan.co.uk

On Mon, 2009-07-27 at 21:54 +0930, tony mount wrote:
> I have a question that follows on from this discussion. I have a loop
> which creates a number of files. It first write each file to a server
> location then sets up the headers and asks the "Save As" question. This
> works OK once, but after the first download it exits without any errors
> or messages. If I remove the header() lines (ie just create the files on
> the server) no worries, it creates them all. (I start op buffer at the
> top of the code and flush the buffer on each loop). Anyone have any
> ideas please?
> Thanks
> Tony 
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] More on "JS alert that links to file"

2009-07-27 Thread Ashley Sheridan
I assume you want to force the files to the user as a series of files to
download? Have you considered just offering a page of links to each
file? You can actually have the links go to a PHP script which can
stream the file as a forced download, and the user can then download the
files one-by-one by clicking the link as if it were a normal link.
Alternatively, you could zip the files up into one archive using PHP and
offer stream that file down to the user.

Thanks,
Ash
http://www.ashleysheridan.co.uk

On Mon, 2009-07-27 at 21:54 +0930, tony mount wrote:
> I have a question that follows on from this discussion. I have a loop
> which creates a number of files. It first write each file to a server
> location then sets up the headers and asks the "Save As" question. This
> works OK once, but after the first download it exits without any errors
> or messages. If I remove the header() lines (ie just create the files on
> the server) no worries, it creates them all. (I start op buffer at the
> top of the code and flush the buffer on each loop). Anyone have any
> ideas please?
> Thanks
> Tony 
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] More on "JS alert that links to file"

2009-07-27 Thread tony mount
I have a question that follows on from this discussion. I have a loop
which creates a number of files. It first write each file to a server
location then sets up the headers and asks the "Save As" question. This
works OK once, but after the first download it exits without any errors
or messages. If I remove the header() lines (ie just create the files on
the server) no worries, it creates them all. (I start op buffer at the
top of the code and flush the buffer on each loop). Anyone have any
ideas please?
Thanks
Tony 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php