Re: ADODB.Stream problem between IE browser and IIS6

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: PA Bear (PABear_at_mvps.org)
Date: 07/22/04


Date: Wed, 21 Jul 2004 20:37:37 -0400

Critical Update for Microsoft Data Access Components - Disable ADODB.Stream
object from Internet Explorer
http://myitforum.techtarget.com/articles/19/view.asp?id=7488

-- 
HTH - Please Reply to This Thread
~Robear Dyer (PA Bear)
MS MVP-Windows (IE/OE), AH-VSOP
AumHa Forums
http://forum.aumha.org
What You Should Know About Spyware
http://www.microsoft.com/mscorp/twc/privacy/spyware.mspx
microsoft wrote:
> 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/downloadfile.asp?fileid=1001959&referid=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/downloadfile.asp?fileid=1001959&referid=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? 


Relevant Pages

  • Re: ADODB.Stream Problem with IIS6 and IE
    ... IIS issue or not. ... when i trigger this script from a link in an email ... > download is not triggered correctly. ... It seems filename and content type ...
    (microsoft.public.inetserver.iis)
  • Re: how to count and extract images
    ... > and then construct the url with the filename to download the image ... parser not only avoids all those problems, it makes your code shorter. ... soup = BeautifulSoup ...
    (comp.lang.python)
  • Re: [Xnews] Downloading incomplete binaries
    ... I want to download "filename", so I queue the parts and hit f4. ... Xnews stops downloading that part because article 4 is missing, ... though the rest of the part is n the server. ...
    (news.software.readers)
  • Re: How to input location of document on a document itself?
    ... Header/Footer toolbar to appear. ... button and choose "Filename and path" from the menu. ... You'll be shown a template to download from ... Microsoft Office Online named "Building Blocks for inserting File Name and ...
    (microsoft.public.word.pagelayout)
  • Re: javascript filename
    ... HTML Document in IE will download it asynchronously. ... After I get the source code, ... >> Does anybody know how can JavaScript get the filename of the file ... > You could try removing script elements with src attributes one at a time ...
    (comp.lang.javascript)