473,324 Members | 2,370 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

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?

Dec 14 '05 #1
2 2291

<te***@yahoo.com> wrote in message
news:11********************@g47g2000cwa.googlegrou ps.com...
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?


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
Dec 14 '05 #2
Thanks, that didn't work but I found the solution -
Response.AddHeader "Content-disposition", "inline; filename=xxx"

Dec 14 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mohit Gupta | last post by:
Hi all, I am using Microsoft Visual Interdev to write/develop ASP code. Refering to code below, when I tried to create object of class "ADODB.Stream", an error was reported by IIS/ASP error engine...
3
by: Harry Hudini | last post by:
Hi, I have an asp page that needs to display the string that is returned from a cgi file. As an example, if you enter http://mydomain.com/mycgi.cgi?98127398 in to a browser, it will display...
2
by: Richard K Bethell | last post by:
Hi, We have an application, written in ASP, that uses the ADODB.Stream to be able to open files and write byte arrays to the Response object. If one of our administrators patches the web servers...
0
by: microsoft | last post by:
Hi, I have an ASP script that initiates a ADODB.Stream like below first bit gets filename from the database strAbsFile = getfilefromDB(request.querystring("fileid")) '-- create FSO object...
3
by: C | last post by:
Re: Microsoft Knowledge Base Article - 870669 How to disable the ADODB.Stream object from Internet Explorer You may recently have heard of the vulnarability exposed by Internet Explorer as...
4
by: Fresh_Air_Rider | last post by:
Hi In the "good old" Classic ASP days, I used to stream records from a SQL Server database out to the user's browser in CSV format by using a combination of COALESCE and the ADODB.Stream object....
5
by: Hardy Wang | last post by:
Hi all, I am new to WSE 3.0, and currently reading the document shipped with installation. From sample provided (see below), I created WSE service side code, but how can I consume stream returned...
7
by: iporter | last post by:
I use the code below to authorise the download of certain files. Thus, instead of linking to the file in a wwwroot directory, I link to this code with the filename as a parameter, and the script...
10
by: =?Utf-8?B?SnVhbg==?= | last post by:
Hi! I want to use ASP to download big files using ADODB.STREAM. It works very fine with files smaller than 80 MB. On the Webserver I can see that memory allocation and the process w3wp is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.