|
it
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ADODB.Stream default filename wrong
I use the Stream method to serve certain file types to the user. If the
type is pdf, it opens in the browser fine. My problem is with those that the browser doesn't have plug-ins such as ppt, word, etc. it prompts to choose Open/Save/Cancel and defaults the filename to the ASP page serving the content. ie. BinarySend.asp -> BinarySend.doc, BinarySend.ppt. If I use Response.AddHeader "content-disposition", "attachment;filename=" & sFileName then it defaults the filename to the name I specify but always prompt a download instead of opening directly. Is there another way to default the filename in situation like this? <te***@yahoo.com> wrote in message
Show quote news:1134520849.937178.4500@g47g2000cwa.googlegroups.com... Are you setting the content type too? e.g.,>I use the Stream method to serve certain file types to the user. If the > type is pdf, it opens in the browser fine. My problem is with those > that the browser doesn't have plug-ins such as ppt, word, etc. it > prompts to choose Open/Save/Cancel and defaults the filename to the ASP > page serving the content. ie. BinarySend.asp -> BinarySend.doc, > BinarySend.ppt. > > If I use > Response.AddHeader "content-disposition", "attachment;filename=" & > sFileName then it defaults the filename to the name I specify but > always prompt a download instead of opening directly. > > Is there another way to default the filename in situation like this? Response.AddHeader "Content-type", "application/vnd.ms-word; name='WORD'" I believe that will make it do what you want. Of course, that means your code must know what that content type is for any given file. -Mark |
|||||||||||||||||||||||