On Tuesday 10 June 2003 08:56 pm, Lee Kimber wrote: [...] > The problem is that the shell script does deliver the file I want but never > names it correctly. The script always names the file with the same name as > the shell script. Eg, the script is a file called "filetest". The file to > download is "/mnt/hdd/logs.tar.gz" > > When I use any browser (Mozilla on Linux or IE on Windows) to hit > http://firewall/cgi-bin/filetest, I get a dialog box prompting me to save > the file as "filetest". If I save it and open it up, it contains the > contents of "logs.tar.gz" - a gzipped tar.
As seen in the code, the echo's aren't being seen in the page code, only the 'cat' command is. You should be able to template one of the existing CGI's to set the tags and have your code interpreted as html code. > The content of the shell script are: > --------------------------------------------------------------------------- >-------------- #!/bin/sh > > echo Pragma: no-cache > echo Expires: 0 > echo Content-Type: application/force-download > echo Content-Type: application/download > echo Content-Type: application/octet-stream > echo Content-Disposition: attachment; filename=logs.tar.gz > echo Content-Transfer-Encoding: binary > echo > > cat /mnt/hdd/logs.tar.gz [...] > I *think* the problem may be to do with mime types because Mozilla prompts > to download a file of type "text/plain" - the default filetype for Bering > weblet, even though the shell script is stating "Content-Type: > application/octet-stream" . It's only seeing the text from the 'cat /mnt/hdd/logs.tar.gz' command. > I don't know. Somehow it feels as though I'm almost there. Am I missing > something simple here? Yep, the text-to-html part in the existing scripts are likely the missing section, unless you want to echo all the tags/headers/etc... -- ~Lynn Avants Linux Embedded Appliance Firewall Developer http://leaf.sourceforge.net http://guitarlynn.homelinux.org:81 ------------------------------------------------------- This SF.NET email is sponsored by: eBay Great deals on office technology -- on eBay now! Click here: http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 ------------------------------------------------------------------------ leaf-user mailing list: [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/leaf-user SR FAQ: http://leaf-project.org/pub/doc/docmanager/docid_1891.html