To force the save window is easy - make up your own content subtype (main
type application)  and set it:

Content-Type: application/x-download-this-file-you-stupid-browser

Remember to start with an "x-" as your type is obviously not registered with
the IANA.

The tricky part is setting up the default file name - if your script is
http://foo.com/cgi-bin/download.pl?filename=bar the save dialog will default
to download.pl; not to the expected "bar".

The solution is to force the file name out of the query string.  You want to
create a URI that looks like
http://foo.com/download/bar?param1=val1&param2=val2 or even better:
http://foo.com/download/val1/val2/bar

You should use mod_rewrite to take requests of this scheme and translate it
to
http://foo.com/cgi-bin/download.pl?filename=bar&param1=val1&param2=val2...
The magic is that you then tell mod_rewrite to trigger an INTERNAL redirect,
so the server works flawlessly without any funny configurations and the
browser never sees it.

If you're using a mod_perl handler, another way to do it is set up a
location /download that calls your handler and read the filename (and
possibly the parameters) directly out of the URI using the request object,
but that's a bit harder (although more elegant and probably uses less
resources then the big mighty mod_rewrite's rewrite engine).

  Issac

----- Original Message -----
From: "Dennis Daupert" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 20, 2002 1:02 AM
Subject: How do I force a 'Save Window?'


> I have file upload working, can upload files of ascii or binary format.
> But a problem when you browse to a page that dynamically displays
> hyperlinks to files. Text and html files display normally in a browser,
> and Word docs popup MS Word as a helper app, and the word doc
> opens fine. But MS Project files popup a browser instance and MS
> Project, and you get the usual "Enable macros" and such popups as
> normal, but only  a subset of the project displays in the browser window,
> and none of the buttons are active in the Project application. Bummer.
>
> How can I force a "Save File" dialog screen for selected files, so the
user
> will have the option to download the file, then open it in Project or
> whatever?
>
>
> Thanks for any help or information.
>
> /dennis
>
> --------------------------------------------------------------------------
-
> Office phone: 817-762-8304
>
> --------------------------------------------------------------------------
-
>  "Great leaders never tell people how to do their jobs.
>    Great leaders tell people what to do and establish a
>          framework within which it must be done.
>           Then they let people on the front lines,
>        who know best, figure out how to get it done."
>             ~ General H. Norman Schwarzkopf
>
>
>
>

Reply via email to