471,075 Members | 809 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

ADODB.Stream Problem between IE browser and IIS6


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 to check if file exists and get properties
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
'-- check to see if the file exists
If objFSO.FileExists(strAbsFile) Then
Set objFile = objFSO.GetFile(strAbsFile)
'-- the filename you give it will be the one that is shown
' to the users by default when they save
Response.AddHeader "Content-Disposition", "attachment; filename=" &
Response.AddHeader "Content-Length", objFile.Size
Response.ContentType = "application/octet-stream"
Set objStream = Server.CreateObject("ADODB.Stream")
'-- set as binary
objStream.Type = 1
Response.CharSet = "UTF-8"
'-- load into the stream the file
'-- send the stream in the response

This works fine when i trigger this script to download the file from a link
in a webpage. However, when i trigger this script from a link in an email or
if i cut and paste the link into the browser and hit enter, the popup file
download is not triggered correctly. It seems filename and content type are
not registered correctly.

I have the same application running on IIS5 and it works fine so i'm
guessing its something between IIS6 and IE6.

I've setup two links so you can try yourself and see if you get the same

The first is link from the webpage

cut and paste the following into your web browser (i've added pass=1 to
bypass the html weblink response)


Correct IE popup would be

Filename : test.pdf
File type : Abobe Acrobat Document
From : www.powerfront.net

Would you like to save the file.....etc
If i cut and paste the link into IE and click enter:

Filename: downloadfile.asp
File type :
From : www.powerfront.net
Message: This type of file could harm your computer if it contains malicious

Would you like to save the file.....etc

For some reason it doesnt get the name of the file and find a content type
although it does allow me to save the file.

For some people using IE they have no problems but others are experiencing
the same problem as me.
I'm using Win XP and have a fully patched system.
Netscape 7 doesnt have the same issue and the correct HTML headers are

Anybody have an Explanation?
Jul 19 '05 #1
0 1995

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Richard K Bethell | last post: by
reply views Thread by Channing Jones | last post: by
10 posts views Thread by =?Utf-8?B?SnVhbg==?= | last post: by
reply views Thread by leo001 | last post: by

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.