Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forcing Download 1

Status
Not open for further replies.

Chipsman

Programmer
May 26, 2005
44
GB
Hi,

I want to make a Download button for each of my files.
I would like that when the user clicks on it, he get the usual 3 options ("Open","Save", "Cancel") that are usual with Windows.

The problem is that when it's a *.eps file, it does it automatically, but if it's a *.doc or *.jpg file, it opens it in IE...

To force the download, someone here told me that I could put the file in a Zip folder. This really force the download BUT it works with Windows versions older than XP. When the user uses XP, the options don't appear and the user get access to the file itself and can alter it...

Does anyone know how I can force the options to appear even when using XP?

Thanks
Chips
 
Put it in a self-extracting zip file. This creates an "exe" file and will download as you want it to.

There's always a better way. The fun is trying to find it!
 
This sounds really nice Tviman. But could you tell me how to put it in a self-extracting zip?

I am using Winzip, couldn't find any option.

Thanks
 
Under Actions, select "Make .Exe". This will make a self-extracting .Exe file with the same name as your original zip file. This method makes it easy for your users as they don't have to have an unzip utility.

There's always a better way. The fun is trying to find it!
 
I'm weary of downloading .exe files. Is there a reason you don't want to just have a link to the file, and let the use decide weather to download, or let IE open it (I don't have the "problem" I use Firefox). The user could simply right click on the link and select "Save Target As..."

Kevin Petursson
 
I believe you need to append a content-disposition header to the response stream to force the download, but not knowing what you're working in, (ASP 3.0, ASP.net, A.N.Other...), or how you're managing the file download it's a little difficult to be more specific.


Rhys

"Vampireware /n/,a project, capable of sucking the lifeblood out of anyone unfortunate enough to be assigned to it, which never actually sees the light of day, but nonetheless refuses to die."

"I see dead pixels!
 
Most of the future users of my site will be total noobs and won't even understand that there is a back button on the IE interface, so they won't be able to right click on a link to "save target". That's why I have to make the link opening an option window proposing to "save" "open" or "cancel" the file download. :-(

I am working with Dreamweaver MX and develope ASP + HTML pages. (basic level, nothing too fancy)
The users will be using Win XP.

Thanks for your help
 
See what happens on a friday? ;-)

To make this easy on myself as it's Friday, here's a couple of links...

Downloading any file using ASP

DevAsp File Downloading Scripts

Force 'file download' for known file types

Hope this helps...

Rhys

"Vampireware /n/,a project, capable of sucking the lifeblood out of anyone unfortunate enough to be assigned to it, which never actually sees the light of day, but nonetheless refuses to die."

"I see dead pixels!
 
Thanks Rhys666 ;-)

I'll have a look at this this week-end, and I'll tell you if it works next week, but it seems to be exactly what I was looking for.

Cheers mate
 
Actually I just tried and it works wonderfully!
Thanks Rhys666 ;-)
 
No Worries

Rhys

"Vampireware /n/,a project, capable of sucking the lifeblood out of anyone unfortunate enough to be assigned to it, which never actually sees the light of day, but nonetheless refuses to die."

"I see dead pixels!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top