Can Apache serve directories as a single archive file
We use a SUSE system here to archive spectra collected from NMR spectrometers. We therefore need to serve out the data for some of our users via the web (local users can use file sharing). BUT Each spectrum is saved as a directory contained a fair number of files. Is there a method of archiving directories on the fly, and serving the result as a single archive file (which could be decompressed by the client's web browser). The ideal would be to compress into a "sit" archive because most clients would be Macintoshes. OR Is there some other way to download a complete directory with basically a single click? Thanks for your feedback. Jim Bews - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Jim Bews, Computing Officer, School of Chemistry, Purdie Building, University of St. Andrews, St. Andrews, Fife, KY16 9ST Tel: 01334-463830 Email: j.r.bews@st-andrews.ac.uk Fax: 01334-463808 WWW: http://ch-www.st-andrews.ac.uk/staff/jrb/
Hi Jim, I do not think that Apache can do this directly, but a simple CGI/mod_perl script should be able to do it for you. I've had a quick look round, but I can't find a perl mod, or free standing app to generate 'sit' files, but would it be a problem to use 'zip'? If not, you can write a small CGI to create a zip file, either calling the zip utility or by using something like the Archive::Zip module. Then once the file's been created you can either return it directly to the browser, or you can send a standard HTML redirector to the new file. If you cannot find a suitable archive file, you try using a CGI to create a HTML file containing links to the relevent files in such a way that they appear to be a part of the page (much line IMG tags). If you do it such that the browser thinks it cannot handle the file, you should see the normal file save dialog appear automatically for each file - to totally automatic, but part way there. Another alternative may be to look at something like rsync or ftp. I believe some ftp servers support on-the-fly zip compression these days. Gary (Who's never actually tried any of the above) On Wednesday 28 November 2001 1:21 pm, Jim Bews wrote:
We use a SUSE system here to archive spectra collected from NMR spectrometers. We therefore need to serve out the data for some of our users via the web (local users can use file sharing). BUT Each spectrum is saved as a directory contained a fair number of files. Is there a method of archiving directories on the fly, and serving the result as a single archive file (which could be decompressed by the client's web browser). The ideal would be to compress into a "sit" archive because most clients would be Macintoshes. OR Is there some other way to download a complete directory with basically a single click?
Thanks for your feedback.
Jim Bews
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Jim Bews, Computing Officer, School of Chemistry, Purdie Building, University of St. Andrews, St. Andrews, Fife, KY16 9ST Tel: 01334-463830 Email: j.r.bews@st-andrews.ac.uk Fax: 01334-463808 WWW: http://ch-www.st-andrews.ac.uk/staff/jrb/
-- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown and undisclosed purposes - Regulation of Investigatory Powers Act, 2000
participants (2)
-
Gary Stainburn
-
Jim Bews