473,387 Members | 1,683 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,387 software developers and data experts.

ADODB.Stream Problem between IE browser and IIS6

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 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)
Response.Buffer=True
Response.Clear
'-- 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=" &
objFile.Name
Response.AddHeader "Content-Length", objFile.Size
Response.ContentType = "application/octet-stream"
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
'-- set as binary
objStream.Type = 1
Response.CharSet = "UTF-8"
'-- load into the stream the file
objStream.LoadFromFile(strAbsFile)
'-- send the stream in the response
Response.BinaryWrite(objStream.Read)
objStream.Close

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
result

The first is link from the webpage
http://www.powerfront.net/secure/dow...eferid=1001960

cut and paste the following into your web browser (i've added pass=1 to
bypass the html weblink response)
http://www.powerfront.net/secure/dow...1001960&pass=1

Example:

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
code.

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
downloaded.

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

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

Similar topics

7
by: Robert Brown | last post by:
Hi All, I am creating an interface into a Payment Gateway. I need to access a URL (which is a perl script) with paramters attached. I will then get a response within 10 seconds with information...
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...
1
by: guyv | last post by:
Hello! I wanna read binary data from database with ADODB.Stream object. So I wrote code.. --------- <% query = "SELECT * FROM Categories" adoDB.DefaultDatabase = "Northwind"
0
by: Channing Jones | last post by:
Hello everyone, I am trying to store data in a binary field of an SQL-Server table using ADODB. So far, I have managed to store a record but not any data in the binary field. I only get...
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....
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.