views:

2031

answers:

3

I have written a watir script that downloads files. One of the files it downloads has a .dcf extension. Months ago, on my machine, I changed a setting somewhere so that .dcf files prompt for download ("Do you want to open or save this file?") instead of opening in the browser. This is the behavior that I desire. I am using XP Pro/IE7.

I'm now setting up a dedicated test machine, but cannot seem to find the configuration option that I did on my machine - which was so easy to find that I didn't make note of it. All of the solutions that I am finding now are either about changing the download itself or modifying the registry. I am looking for something from the client perspective at the browser/IE level.

+1  A: 

instructions here:
http://www.mydigitallife.info/2007/06/15/disable-automatic-opening-or-saving-of-downloads-re-enable-always-ask-before-check-box/

tloach
I've followed those directions and unchecked the 'Confirm open after download' in the File Type dialog. The file still opens in a browser window.I also checked the machine that is working the way that I want, and the 'Confirm open after download' is still checked there.
mandersn
A: 

For PHP, try using these headers:

header("Content-Type: application/force-download");

header("Content-Type: application/octet-stream");

header("Content-Type: application/download");

header("Content-Disposition: attachment; filename=".basename($filename).";");

Naturally you can make use of the same headers in whatever language you are using.

Eduardo
You get it wrong (as I did when first read the question). He is asking about IE7, not really a programing question.
Eduardo Molteni
Not really, I just missed the 'F' before the 'or' in the beginning of the answer. But I totally understood it.
Eduardo
A: 

tloach's link provided direction towards the answer I needed:

  1. I needed to open a windows explorer window and select Folder Options... from the Tools menu.
  2. I needed to go to the File Types tab and locate the extension for which I wanted to change behavior.
  3. I needed to have the Advanced button for the file type - it isn't always there.
  4. The Confirm open after download checkbox needs to be checked (not cleared)
  5. There need to be Actions - there aren't always. I found that one called edit and another called open were enough. I tied them to notepad (C:\WINDOWS\system32\NOTEPAD.EXE %1). I also needed to check the Use DDE checkbox and fill in NOTEPAD for Application: and System for Topic:

Hopefully this will help others. It will likely help me the next time.

mandersn