View Full Version : How to avoid opening user-end app. ?
marty1101
08-01-2001, 02:57 AM
This HTML code opens user-end Excel in the browser.
click to download the blackjack secret: <a href="http://www.hellomarty.net/Blackjack.xls">Blackjack.xls</a>
How do I make it downloadable only? :o
John Kennett
08-01-2001, 05:46 AM
Terra came up with a solution for this recently in another thread! Here's how to do it:
1) Put the download files in a directory on their own
2) Create an .htaccess file for that directory
3) Add the following line:
AddType application/octet-stream .xls
That should force the browser to download the file by saying this is a
pure binary file stream that has no real handler...
It works too! :V
John
janderk
08-01-2001, 08:56 AM
I cannot get this thing to work. My .htaccess (permissions: rw-r--r) file contains the following code:
/big/dom/xdigitaldutch/www/arles/examples/download/.htaccess
AddType application/octet-stream .pdf
To test I put a example pdf file in a directory of my web site:
www.digitaldutch.com/arles/examples/download/x.pdf
Just click it to prove that it still opens in the Browser. I must be doing something stupid... but what :confused:
Jan Derk
Terra
08-01-2001, 10:02 AM
Jan:
Your right, at least in testing with my IE 5.5 browser... Seems that Adobe Acrobat is wanting to handle it no matter what the Apache server is suggesting that the browser should do...
This is a direct check to ensure you AddType was in fact working:
GET http://www.digitaldutch.com/arles/examples/download/x.pdf --> 200 OK
Connection: close
Date: Wed, 01 Aug 2001 12:57:10 GMT
Accept-Ranges: bytes
Server: Apache
Content-Length: 18439
Content-Type: application/octet-stream
ETag: "49032b-4807-3b67dde0"
Last-Modified: Wed, 01 Aug 2001 10:45:52 GMT
Client-Date: Wed, 01 Aug 2001 12:57:10 GMT
Client-Peer: 63.236.215.29:80
As you can see, the 'Content-Type' is set as directed however the browser has it's own idea of how to handle it... Most likely it is ignoring the MIME type and making the decision based on file extension '.pdf'...
If the browser chooses to ignore the Apache server's suggestion, then I'm afraid there may not be much you can do other than directing your viewers to 'right-click' and 'save as'...
--
Terra
--Nobody listens to me anyways--
FutureQuest
marty1101
08-01-2001, 12:15 PM
Thanks, John. and Terra is right. I tried Opera 5 and Netscape too.
Opera and Netscape let you set up what to do with each type of file, so it is the user's choice.
but I can't find similar configurations in IE5.5
However, I tried to send a 514.doc in the attachment to my Yahoo! Mail account. Click the download
link and a Download File window pops up!!! You can choose to open this file from its current
location or save it to the disk. The link is:
http://us.f140.mail.yahoo.com/ym/ShowLetter/514.doc?box=Inbox&MsgId=2152_602708_553_917_44622_0_63&bodyPart=2&filename=514.doc&download=1&YY=15422&order=down&sort=date&pos=0
It works with Opera 5, Netscape 4.7, and IE5.5. There must be a way to tell the browser to bring
up this window. Is it in the link or somewhere in the page? anybody? I have no idea where to
look for the answer. Please enlighten me. Any idea could be helpful.
You must take care in this type of testing to compare apples to apples. Just because your browser does something for a .doc file, does not mean it will do the same thing for a .pdf file.
Also, unless you plan for all your users to get your downloaded file via Yahoo mail, trying to compare the Yahoo mail application to the browser application provides little help.
The Explorer browser (on some installations) will open and not download the .pdf file because there is an extension installed to automatically handle anything with a .pdf extension. You *might* also see similar activity for .doc, .xls, or any other extension.
If you don't want to instruct your users to use the right-click procedure to download the file, then your only reliable method will be to create a link to a script that invokes the download window (probably via a javascript). This is probably what Yahoo is doing.
Rich
marty1101
08-02-2001, 03:03 PM
Again I'm hitting the wall of Javascript. It seems when things come to usability, Javascript stands in the middle of the road. Is there any Javascript "bible" good for learning it ?
I am used to bullet-proof programming where no exception is allowed. Users will appreciate easy-to-use features. Another thought before I dig into Javascript: since it's a client-side script, would it be copied ?
Cheers,
Ok I am sure there is a reason no one has suggested this, most likely because you either can't or some other obvious reason that these 'Ole eyes just don't see at the present time, BUT couldn't you just zip up the file and present the zipped file for download?
Bob
- Waiting for the Obvious to hit me between the eyes :GULP: -
marty1101
08-02-2001, 03:25 PM
Oh! yes, I haven't thought of this, but it's not in my consideration. I know I didn't make the question clear, but that was to invite more variety of ideas. Thanks for your thought, Bob.
You can see what I'm doing on my site: hellomarty.net
I want the users encrypt their *.* and maybe a year after download their origional file without knowing anything else. Usability is the biggest concern. It's only an experiment for now. SSL and user password are ahead to come.
Tibbits
08-14-2001, 04:58 AM
I have a javascript reference I downloaded ages ago as part of the WHS reference from Microsoft, although I doubt it's still available. I could probably send you a copy if you needed it though.
marty1101
08-14-2001, 09:46 AM
That'll be great if you can email it to me. I still don't have a solution yet.
my email is marty@hellomarty.net Thanks!
vBulletin® v3.6.8, Copyright ©2000-2009, Jelsoft Enterprises Ltd.