Mobile app version of vmapp.org
Login or Join
Becky754

: How can I make my binary file is served as binary and not text when user choose "Save Linked File As..." in Safari? I'm serving a binary file (.IPA) with Ubuntu/Apache 2.2. When I have chosen

@Becky754

Posted in: #Apache #Safari #Ubuntu

I'm serving a binary file (.IPA) with Ubuntu/Apache 2.2.
When I have chosen Save Linked File As... in Safari, it says it's text file. And it guides me to add .txt extension. However it does not add any extra extension when I download it just clicking link.

I added line AddType application/octet-stream .ipa in apache configuration file. I don't know what's wrong with this. Is this a bug of Safari or my misconfiguration? (1) If it caused by bug, how can I avoid this? (2) Or if it caused by misconfiguration, what should I do?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Becky754

1 Comments

Sorted by latest first Latest Oldest Best

 

@Nimeshi995

It is caused by Safari's behaviour and can be avoided by using JavaScript to disable context menus:

var browser = navigator.userAgent;
if (browser.toLowerCase().indexOf('safari') > 0)
{
var allLinks = document.body.getElementsByTagName('a');
for (var i=0; i<allLinks.length; i++) {
allLinks[i].oncontextmenu = function() { return false };
}
}

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme