|
Posted by Andy Dingley on 10/26/06 12:24
thisis wrote:
> I have an asp/html page that opens a "download/save file as" box,
It doesn't. What it does is it offers a link to some content (with <a
href="foo" > ) and _that_content_ causes the "save as" dialog to
appear, for some population of users. In particular the HTTP
content-type header that's supplied with this content will trigger it.
You can't control this triggering. It's usually not a response _to_
something definite, but a response when that thing isn't recognised.
Some browsers will now display XML, some (older) browsers won't
recognise it and so they fall back to a default of offering to save it
for you. Much depends on the particular config of particular browsers
for particular users. HTML is always going to be displayed. ZIP files
will be saved. XML could go either way, and you can't predict this.
You can _suggest_ the display / save switch. A well-admined server will
already do this, or you can control it yourself through ASP. They
recognise the file extension and select an apropriate content-type
automatically. Sending "recognised and displayable" content-types
causes display, Sending "known but undisplayable" types causes a save,
as does "unknown" -- in most cases. Remember that this is the
_browser's_ list, and you don't know it exactly.
If you want to "recommend" saving rather than display, then send a
content-type that's likely to do this for most browsers. As you don't
say what your content is, then it's hard to recommend one (although
application/octet-stream might do the trick).
For a simple "quick hack", then just zip the file up and link to the
zipfile.
[Back to original message]
|