0

Recently I switch from one hosting (A Hosting) to another hosting server (B Hosting). Previously my Mac's Safari using able to download the MP3 by, right click "Download Linked File As.." to save the MP3 to local machine.

However, once I switch to another hosting, with the same PHP code, same MP3. B Hosting webserver, cannot save the MP3, but only allow streaming from the website (Full Screen Audio Player). On the Safari Downloads Windows, it shows "Zero KB of ? - The requested URL was not found on this server." This is impossible. I believe it is same kind of setting in the server make this option not available.

After I did some research, some Mac User said that we can use "Option"+"Click" to download the MP3. This method works for A Hosting and B Hosting. I just want to know how to fix "Download Linked File As..." to make in work in B Hosting.

Thanks!

Update:-

A Hosting:

Hosting A

B Hosting:

Hosting B

As you can see A Hosting didn't have Content-Disposition, but Safari don't have any issue to download the file. Is it really Content-Disposition matter?

Shiro
  • 823
  • 8
  • 13

1 Answers1

0

It's about content-disposition header (http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html) and/or default or strict MIME type configured on web server, by default webservers like apache use text/plain, switching to application/octet-stream solves the problem.

GioMac
  • 4,444
  • 3
  • 24
  • 41
  • I am using cPanel, where can I do the changes? Please advice? Thanks! – Shiro Sep 11 '13 at 09:46
  • http://docs.cpanel.net/twiki/bin/view/AllDocumentation/CpanelDocs/MIMETypes if not configured for your file extension - you must add it – GioMac Sep 11 '13 at 09:48
  • I checked both of the MIME Type in cPanel, for MP3 extension, both also config the same which is `audio/mpeg | mpga mp2 mp2a mp3 m2a m3a` I added `application/octet-stream | mp3` still did not make any different. Any help? – Shiro Sep 11 '13 at 16:49
  • what about `Content-Disposition`? – GioMac Sep 11 '13 at 16:54
  • can you give some example about the `Content-Disposition`, edit your answer please. Thanks! – Shiro Sep 12 '13 at 11:31
  • http://www.jtricks.com/bits/content_disposition.html – GioMac Sep 12 '13 at 11:34
  • http://stackoverflow.com/questions/1012437/uses-of-content-disposition-in-an-http-response-header – GioMac Sep 12 '13 at 11:35
  • i updated my question with print screen header information for two hosting server. Is it really `Content-Disposition` matter? – Shiro Sep 13 '13 at 14:24
  • You're at wrong place. These aren't files to be downloaded - look at content-lenght. Safari isn't displaying request-response headers for downloads. – GioMac Sep 13 '13 at 14:26
  • means I need to check for .mp3 not the html? – Shiro Sep 14 '13 at 04:13
  • sure, html doesn't decide anything. – GioMac Sep 14 '13 at 04:33
  • ok, I tried with Safari view the header, there is no Response Headers when I open in new tab. Do you mind to do a print screen to show how it is display in Safari Inspect Element – Shiro Sep 14 '13 at 11:10
  • you can't do this with browser. – GioMac Sep 14 '13 at 17:04
  • so how do I inspect the header in this case? I can see distinct different between two hosting. – Shiro Sep 15 '13 at 09:55