I'm stumped by this problem with Apple Safari; perhaps you can help.
Here's the situation. I have a file that I make available for others to download. The file happens to be a Notes template but it could be any file with a non-standard extension.
The file is on a hosted web site at GoDaddy. I upload files there to make them available for download.
Here's an example:
http://download.eproductivity.com/thisisanemptynotestemplate.ntf
On a PC, if you click on that link from IE, FireFox, Chrome, or Safari, the browser will prompt you to Open or save the file, like this:

On a Mac using the Apple Safari browser the experience is completely different. If you click on that same link in Safari the browser tries to open the file, which results in a screen full of garbage, like this:

It appears that Safari on the Mac is trying to open and display the file, which of course is not want I want.
Bruce Elgort, (creator of IdeaJam - there's my shameless plug) tried to help today by running the same tests in various browsers on his Mac and it worked in all but Apple Safari.
On a Mac, if you click on that link from FireFox, it works fine:

On a Mac, if you click on that link from Google's Chrome browser, it starts downloading immediately:

Any ideas on how I can get the Apple Safari browser to successfully download this file? I'd hate to have to tell Apple users they have to use a different browser or buy a PC. ;-)
Thanks.
Update: I don't think it should matter, but I do not actually give the user the direct URL. Instead, we have a button with some script behind it that redirects the user to the URL. I simply posted the direct URL above for testing purposes. This feels like either a mime-type issue or more likely a bug in Safari. Any help would be welcome.
Discussion/Comments (5):
Erick, this is the bad habit of Safari to open everything in the browser, if you ask the users to hit the "CONTROL' key before hit the link they will be able to download the file.
I send you an screen shot to your email.
best,
APO
Posted at 06/21/2010 16:48:26 by Augusto Pinaud
Thanks for the feedback. I suspected as much.
In our case the user is not actually clicking on a link but a buttonwith some script behind it that redirects the user to the URL. I simply posted the direct URL above for testing purposes. (I will updatethe blog post with details.)
If you have Safari and want to try the process yourself, go to this page and download anything... http://www.eProductivity.com/download.
Thanks.
Posted at 06/21/2010 17:04:33 by Eric Mack
The solution was to define the content type in an .htaccess file
I'm documenting this here for the benefit of anyone that may search this in the future.
In short, I concluded that the content type was not being recognized by Apple Safari and that the Safar Browser on Mac defaults unknown file types to text - which means it tries to display them -- rather than binary, which would cause the browser to prompt you for what to do next.
I originally went to my Domino server to set the content type but quickly realized that this would not work as the actual files were on another server and the content type is set by the server where the files reside and not the server where the html calls the file from.
So, long story short, here is the solution I used:
1. Create (or edit) an .htaccess text file in the root of the Linux web server where the files reside
2. Insert these two lines:
AddType binary/octet-stream .ntf
AddType binary/octet-stream .nsf
3. Save the file.
Done.
The above two lines will tell the browser that when presented with files of type .nsf (Notes database) or .ntf (Notes template) treat them as any other binary file. Most browsers will immediately prompt the user "do you want to download or open this file?" while Chrome will simply download the file.
Special thanks to Robert Peake, Bruce Elgort, and Agusto Pinaud for their help.
Posted at 06/22/2010 14:43:39 by Eric Mack
First of all I'm limited in understanding how to do very much on computers. I asked someone for help on how to do something and when i returned later to my computer my page was black with a warning headlined in red ( Warning: Possible
phishing site ) You probably know the rest. In any case I've never seen this before and it happens before i can access anything. I took a chance and ignored it but I have fear. What should i do? Please Help
Posted at 10/01/2010 9:35:15 by lehad Dhouti
situation resolved, thanks.
Posted at 10/01/2010 17:18:16 by lehad Dhouti
Discussion for this entry is now closed.