Hi Jon,
There is no magic solution to what you are trying to accomplish.
Before I suggest a few methods to consider (although none of them will
give you the result you are looking for 100% of the time), here is an
explanation as to why there is not such feature that would work on
every system:
The web protocols were designed to identify the MIME Content-type
headers (type of content data), but not what task should be performed
on them once a header is identified (source + more info at:
http://webtips.dantobias.com/force.html ).
Defining what should be done with the content type once it is
identified would reduce flexibility. Because each system is
different, a lot of systems would be unable to do what is requested of
them.
This type of dilemma has been around for a long time in other forms.
For example, did you know that using the <BOLD> tags might not work on
some older systems? The reason is simple: BOLD tells the browser in a
very specific way HOW to process the tag. If your web browser does
not understand any of the commands it will give up, not knowing what
to do. An alternate tag, which will accomplish the same job even on
older browsers, is <STRONG>. This tag tells the browser of what the
final result should be, not how it should be created. The browser is
than set free to accomplish its job in a way it has been told to do
it. <BOLD> takes the control away from the web browser and not only
tells it WHAT to do, but also HOW to do it.
Not specifying how to handle the data on the remote system also lowers
the security risks (so, i.e., .exe files don't execute themselves upon
transfer). So, main reason for not being able to do what you are
asking with a 100% success rate is security and compatibility.
Now, this is the part where you might find a little more favourable
information. It deals with a few ways of accomplishing your task with
as much compatibility as possible:
Try using the application/octet-stream for your MIME type. The web
site, which suggests this method, mentions MACs. Supposedly this is
one of the better options.
ASP code to accomplish your task can be downloaded from
http://www.asp101.com/articles/jason/filedownloadlist/filedownloadlist.zip
Another ASP example:
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=4&txtCodeId=7351
The ASP examples are from
http://4guysfromrolla.aspin.com/home/tutorial/file/updownlo?cob=4guysfromrolla
where you will find about 30 file transfer utilities (not all for
downloading).
You might want to browser through there in case there is something
better I might have missed.
Now on the more difficult spectrum, VBScript download force:
http://www.morningz.com/mz/crystal/safilemgr/safilemgr.asp
Most browser allow download forcing by holding the SHIFT key when
clicking the file. There is some popular browsers, which DON'T
support this feature.
I hope that between these methods you will find something that serves
you with content (since the perfect solution does not exist, but than
again the simplest of things on the web are not compatible with
everyone out there).
Thank you, and best of luck to you.
Slawek |