Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old December 14th, 2005, 12:55 AM
tedqn@yahoo.com
Guest
 
Posts: n/a
Default 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?

  #2  
Old December 14th, 2005, 03:45 AM
Mark J. McGinty
Guest
 
Posts: n/a
Default Re: ADODB.Stream default filename wrong


<tedqn@yahoo.com> wrote in message
news:1134520849.937178.4500@g47g2000cwa.googlegrou ps.com...[color=blue]
>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?[/color]

Are you setting the content type too? e.g.,

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


  #3  
Old December 14th, 2005, 11:15 PM
tedqn@yahoo.com
Guest
 
Posts: n/a
Default Re: ADODB.Stream default filename wrong

Thanks, that didn't work but I found the solution -
Response.AddHeader "Content-disposition", "inline; filename=xxx"

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles