Hi,

I've been tinkering with a weblet cgi script to download logs that I'm keeping on a spare hdd in one of my Bering systems. I've put an ash shell script in /var/sh-www/cgi-bin/.

I'm close... oh so close... but not quite there!

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.

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
-----------------------------------------------------------------------------------------

/etc/sh-httpd.mime contains:

htm     text/html
html    text/html
txt     text/plain
css     text/css

gif     image/gif
jpg     image/jpeg
jpeg    image/jpeg
tif     image/tiff
tiff    image/tiff
png     image/png

lrp     application/octet-stream
gz      encoding/x-gzip
tgz     encoding/x-gzip

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" .

I don't know. Somehow it feels as though I'm almost there. Am I missing something simple here?

Thanks!



-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
------------------------------------------------------------------------
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

Reply via email to