Content-type for dynamically generated non-html files 
Author Message
 Content-type for dynamically generated non-html files

Is there any reliable way of pre-filling the filename field in the download
dialog box in IE4?  I am using Software Artisans SAFile control to output a
document directly from a database, and using their exampe of:

Response.Addheader "Content-Disposition", "inline; filename=""sample.doc"""

only works with Netscape

Specifying a bogus querystring:

download.asp?file=bogus.doc

doesn't work either.

Any ideas?

Tim



Thu, 18 Oct 2001 03:00:00 GMT  
 Content-type for dynamically generated non-html files
Tim,

Unfortunately, IE sees the .DOC extension and tries to open the word viewer.
Netscape on the other hand looks at the MIME type. (Infact, the MIME type
was created just for this reason!). So, unless you change the name of the
file to say bogus.xxx where xxx is a "unhandled" extenstion, there is no way
around this.

--
Manohar Kamath
Microsoft MVP - ASP
www.kamath.com Active Server Corner

Quote:

>Is there any reliable way of pre-filling the filename field in the download
>dialog box in IE4?  I am using Software Artisans SAFile control to output a
>document directly from a database, and using their exampe of:

>Response.Addheader "Content-Disposition", "inline; filename=""sample.doc"""

>only works with Netscape

>Specifying a bogus querystring:

>download.asp?file=bogus.doc

>doesn't work either.

>Any ideas?

>Tim




Thu, 18 Oct 2001 03:00:00 GMT  
 Content-type for dynamically generated non-html files
we are using this sequence and have no problems with any documenttype
in NN4 and IE4

--------------------------------------------------------------------------------
' set a http header of type Content-Disposition (RFC2183)
' to suggest the client a document name
Response.AddHeader "Content-Disposition", "filename=" & DestinationName

' set the MIME type to application (octet stream seems to work)
Response.ContentType = "application/octet-stream"
----------------------------------------------------------------------------

hope, that helps

marco

Quote:

> Is there any reliable way of pre-filling the filename field in the download
> dialog box in IE4?  I am using Software Artisans SAFile control to output a
> document directly from a database, and using their exampe of:

> Response.Addheader "Content-Disposition", "inline; filename=""sample.doc"""

> only works with Netscape

> Specifying a bogus querystring:

> download.asp?file=bogus.doc

> doesn't work either.

> Any ideas?

> Tim




Mon, 22 Oct 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Html and nonHtml content type

2. Using ASP + VBScript to provide non-HTML Content

3. set content type to text/html programaticaly?

4. Using WIN32 API to generate PDF files from HTML

5. Generating and html file with VB5

6. Generate HTML File from Crystal Report 7.0

7. Generating HTML Help files

8. Jscript Files Content-Type

9. REQ: SMTP COM component that can rewrite Content-Type header and attach files w/o encoding

10. How do I create a VBScript to generate an HTML file listing of a directory

11. How to generate a html file using VB/ASP

12. Getting the content type of a file

 

 
Powered by phpBB® Forum Software