PDA

Click to See Complete Forum and Search --> : download link won't work properly


Gravity
04-16-2008, 03:56 PM
I've got a link that is supposed to download an ".ies" file (lighting engineers use it) but when the link is clicked you can view it in the browser window.

This is the old page (http://guth.com/photometry/viewBrand.asp?brandid=50) I'm trying to functionally duplicate. Note it's an .asp page. If you click on the lightbulb it brings up a download dialougue box.

Here's the new page (http://www.bsk1000.com/GUTH_WEBSITE/photometry_files/2in1_bracket/2in1_Bracket.html)... It just opens up the file in a browser window. Also, if you try to "save link as" it adds a .txt on to the end of the file, which is no good.

How can I force a dialougue box to open when the link is clicked on?

Drazan
04-16-2008, 06:48 PM
The keywords you are looking for is content-type "application/octet-stream" image/ies

or something like that.

It's a mime type to tell browsers to handle the file as a binary or executable. This means that the browser will handle the file in its original format and then you just need a little script to force the download.

That's all I remember off the top of my head. But if you google the term - I'm sure you'll come up with ways to implement it.

Jade

Gravity
04-16-2008, 10:16 PM
thanks for the reply... that's what I figured I'd have to do based on a web search. Unfortunately everybody tells you the code snippet, but not how to implement it... Oh well. If I don't figure it out, I'll just put a "save link as" instruction.

cnic
04-16-2008, 11:23 PM
couldn't you just zip the file and then link it to download the zip?

Gravity
04-16-2008, 11:25 PM
good solution!

shalom_m
04-17-2008, 08:19 PM
See: http://www.boutell.com/newfaq/creating/forcedownload.html
and: http://webtips.dan.info/force.html