Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security NTBugtraq
[Top] [All Lists]

ActiveFile, XP+SP2, file download does not work

Subject: ActiveFile, XP+SP2, file download does not work
Date: Fri, 8 Oct 2004 15:30:57 -0400
Russ,

If you use the ActiveFile control to download files to your clients
using IE then you will find that the behavior of the
Browser changes with the addition of SP2 to XP.

Previous behavior: IE would prompt to download a file.
New behavior: IE opens the file using the file association in the OS.
Even though .txt files are usually associated with
Notepad, IE will open the file and display the contents in the browser.

Here's some old code that will display the file in the browser rather
than prompt for download:

        Set File = Server.CreateObject("ActiveFile.File")
        File.Name = "d:\websites\download\"+this_filenamex
        Response.Clear
        Response.AddHeader "Content-Disposition", "inline; filename=" &
File.FileName
        File.Download "application/unknown",now(),true,true


The fix for this problem is to change the "inline" attribute in
"Content-Disposition" to "attachment" and this will force a download of
the file, even for known MIME types like MS Word. The new line of code
would read:

         Response.AddHeader "Content-Disposition",
"attachment;filename=" & oFile.FileName

In addition, if you leave "inline" in place and put a backslash in front
of the file name then you will get a prompt to save
the file using the current asp file name.

Also, if you delete the file association for .txt in the OS then IE will
open the file in Notepad not IE. This was old behavior.

Some of this is documented by MS at:
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.
com:80/support/kb/articles/Q260/5/19.ASP&NoWebContent=1

IMHO, it looks like "inline" never worked correctly and now MS is
correcting it without notifying us lowly programmers.

Hope this helps.

Regards,
Bobby Ballard
bobbyb@redeposit.com

--
NTBugtraq Editor's Note:

Want to reply to the person who sent this message? This list is configured such 
that just hitting reply is going to result in the message coming to the list, 
not to the individual who sent the message. This was done to help reduce the 
number of Out of Office messages posters received. So if you want to send a 
reply just to the poster, you'll have to copy their email address out of the 
message and place it in your TO: field.
--

<Prev in Thread] Current Thread [Next in Thread>
  • ActiveFile, XP+SP2, file download does not work, Bobby Ballard <=