Hi Chris,

That makes sense. I'll give it a try and let you know.

Thanks,

Mark

On Aug 21, 2004, at 12:07 PM, Chris Devers wrote:

On Sat, 21 Aug 2004, Mark Wheeler wrote:

I have a picture gallery I building for my family. When a movie or picture is displayed, I want them to be able to save it. But... if I just provide a link in the coding to the actual file, it will open up in the browser window and be displayed. Is there a way to have download, either automatically or by a "Save As..." dialog box, the file rather then displaying it? I hope that was clear. :)

This is untested, but I'm guessing that you could write a simple CGI script that takes the URL for an image as an argument -- maybe just using $ENV{'HTTP_QUERY_STRING'} so that the url can be simple like --


    http://site/images/fetch.pl?path/to/image/file.jpg

-- and then have your script find "path/to/image/file.jpg" and spool it back to the client with a Content-type of "application/octet-stream" instead of "image/jpeg".

This can probably be done with about half a dozen lines of code, and if the browser is well behaved -- that'll be the part that's a pain to verify -- the alternate content type should force the right behavior.

Let me know if you find this description unclear...


-- Chris Devers [EMAIL PROTECTED] http://devers.homeip.net:8080/blog/

np: 'Ham 'n' Eggs'
     by A Tribe Called Quest
     from 'People's Instinctive Travels And Paths Of Rhythm'



Reply via email to