Re: Suggestions for creating an archive

2005-09-02 Thread Dermot Paikkos
On 2 Sep 2005 at 10:20, Perrin Harkins wrote: > On Fri, 2005-09-02 at 11:34 +0100, Dermot Paikkos wrote: > I don't really understand why you have two scripts. You should just let > apache handle serving the zip as a static file. It's much better at > that than any script you write will be, sinc

Re: Suggestions for creating an archive

2005-09-02 Thread Perrin Harkins
On Fri, 2005-09-02 at 11:34 +0100, Dermot Paikkos wrote: > I did get carried away abit with the redirection, I was thrahing around > by that time. Interestingly you haven't use content-dispostion either. It has no effect on a redirect. > In the end I created 2 scripts, one to archive and dump th

RE: Suggestions for creating an archive

2005-09-02 Thread Chris Werner
Title: RE: Suggestions for creating an archive colin_e wrote: > a) User invokes script as "script.pl" > > b) Script redirects to "script_downloader.zip" >    (But configure Apache to pass this back to the original script). > I'm sorry, maybe thi

Re: Suggestions for creating an archive

2005-09-02 Thread Dermot Paikkos
On 1 Sep 2005 at 12:40, Perrin Harkins wrote: > > The Location header is for redirects, not for internal redirects. > You're doing too many things at once here. Just drop all of this and do > a normal redirect to the file. You can use CGI.pm's redirect() > function, or do something like this (mo

Re: Suggestions for creating an archive

2005-09-01 Thread colin_e
I've read in at least one place (a PHP book I think) that browsers are very inconsistent in their handling of the content-disposition header. Some will "believe" the suggested filename, but ignore the extension, and implied file type. Have you considered looping back to your own script with a

Re: Suggestions for creating an archive

2005-09-01 Thread Perrin Harkins
On Thu, 2005-09-01 at 14:49 +0100, Dermot Paikkos wrote: > I tried to end the handler with a REDIRECT rather than an OK > status, thinking that this was a really a redirect. Nope, that's for internal redirects. > print STDERR "redirecting, length=$length, "; > $r->header_out( > 'Content-

Re: Suggestions for creating an archive

2005-09-01 Thread Dermot Paikkos
On 31 Aug 2005 at 13:48, Michael Peters wrote: > > There is a way to do it, defined as part of HTTP or MIME -- I can't > > quite remember. If you do an external redirect you won't have to bother > > figuring it out. > > If you are generating your own content headers you use the > Content-Disposi

Re: Suggestions for creating an archive

2005-08-31 Thread Dermot Paikkos
Excellent. I give it a try tomorrow. Dp. On 31 Aug 2005 at 13:48, Michael Peters wrote: > > > Perrin Harkins wrote: > > On Wed, 2005-08-31 at 18:38 +0100, Dermot Paikkos wrote: > > > >>Do you mean a redirect to a completely separate handler or cgi? > > > > > > I mean a standard redirect

Re: Suggestions for creating an archive

2005-08-31 Thread Mike Whitaker
On 31 Aug 2005, at 18:43, Perrin Harkins wrote: There is a way to do it, defined as part of HTTP or MIME -- I can't quite remember. If you do an external redirect you won't have to bother figuring it out. Content-Disposition: rings a bell.

Re: Suggestions for creating an archive

2005-08-31 Thread Michael Peters
Perrin Harkins wrote: > On Wed, 2005-08-31 at 18:38 +0100, Dermot Paikkos wrote: > >>Do you mean a redirect to a completely separate handler or cgi? > > > I mean a standard redirect to a normal .zip file, which you let apache > serve for you like any other file. Then you clear these out > pe

Re: Suggestions for creating an archive

2005-08-31 Thread Perrin Harkins
On Wed, 2005-08-31 at 18:38 +0100, Dermot Paikkos wrote: > Do you mean a redirect to a completely separate handler or cgi? I mean a standard redirect to a normal .zip file, which you let apache serve for you like any other file. Then you clear these out periodically with a cron job. > So I gues

Re: Suggestions for creating an archive

2005-08-31 Thread Dermot Paikkos
On 31 Aug 2005 at 13:14, Perrin Harkins wrote: > On Wed, 2005-08-31 at 18:09 +0100, Dermot Paikkos wrote: > > $r->internal_redirect("myzip.zip"); > > That's supposed to be a URL: "/myzip.zip" > > I was actually thinking of an external redirect, but an internal > redirect should work. Do you mea

Re: Suggestions for creating an archive

2005-08-31 Thread Mike Whitaker
On 31 Aug 2005, at 17:40, Perrin Harkins wrote: On Wed, 2005-08-31 at 17:18 +0100, Dermot Paikkos wrote: I need to create a archive file and send it back to the user. Either do a system call to zip, or use Archive::Zip, write the file out in a directory under your web server, and send a

Re: Suggestions for creating an archive

2005-08-31 Thread Perrin Harkins
On Wed, 2005-08-31 at 18:09 +0100, Dermot Paikkos wrote: > $r->internal_redirect("myzip.zip"); That's supposed to be a URL: "/myzip.zip" I was actually thinking of an external redirect, but an internal redirect should work. - Perrin

Re: Suggestions for creating an archive

2005-08-31 Thread Dermot Paikkos
On 31 Aug 2005 at 12:40, Perrin Harkins wrote: Sorry I guess that should be $r->internal_redirect("http://austin/Myzip.zip";); That what the bad uri means. Still my archive file arrives empty even though the actual archive in /var/www/htdocs has files files in it. Dp. ~~ Dermot Paikkos * [E

Re: Suggestions for creating an archive

2005-08-31 Thread Dermot Paikkos
I had tried Archive::Zip earlier but gave up after this error. Here what I have at the moment.: ...snip my $zip = Archive::Zip->new(); my $member = $zip->addDirectory('myarchive/'); chdir("$dir") or die "Can't cd into $dir: $!\n"; my @jpegs = glob("*.jpg"); foreach my $f (@jpegs) { $me

Re: Suggestions for creating an archive

2005-08-31 Thread Perrin Harkins
On Wed, 2005-08-31 at 17:18 +0100, Dermot Paikkos wrote: > I need to create a archive file and send it back to the user. Either do a system call to zip, or use Archive::Zip, write the file out in a directory under your web server, and send a redirect to the newly written file. - Perrin

Suggestions for creating an archive

2005-08-31 Thread Dermot Paikkos
Hi, Apologises if this is a little OT but I am can't seem to find anything relevant elsewhere. I am currently using MP1, 1.29 on Linux. I need to create a archive file and send it back to the user. The files within the archive will be jpegs so compression isn't needed, but I need the archive so