“Save as” for audio files from Safari misbehaving

I’ve been encountering this issue for awhile, and it looks like it’s been a standing issue for some time and it’s not just me. But I figure if anyone has the answer, it’s someone on here.

When there’s an MP3 that’s linked to in Safari, I can easily download it by right-clicking to “Download Linked File.”

If I’m using a browser other than Safari (I’ve tested with Firefox and Chrome) and I open up a link to an MP3 file, I can save it just fine.

In Safari, playing it in the browser works just fine, but if I try and save the file, opening it in QuickTime, IINA, or VLC gives me the error “Cannot open file or stream!”

I’m going crazy with this. I can’t believe the solution is that, for such a simple task, I need to switch browsers on occasion or, as the post I linked above suggested, make an HTML hyperlink for every MP3 I find. There are many times where that’s not practical.

This has occurred with countless MP3s and other audio files from countless origins, and again, not in other browsers. I’m vaguely recalling this happening with video files too, though I don’t recall or have one on-hand to test (here’s an audio file to test with.) Has anyone else solved this?

I think the problem is that (I believe) your method of “saving” of the file actually invokes “Save As”, which only (on my system, at least), shows 2 file formats: web archive and page source. If a single mp3 file is opened in a browser window, trying to save it will force it into one of the two formats — neither of which is an audio file.

(This happens because when you choose to “open” an mp3 file in Safari, Safari can’t actually do that. What it does is create a web page on the fly to display that mp3 file with playback controls.)

In short, I think this is intentional behavior (even though it’s not what you want!).

If you want to be able to open an audio file in a Safari window, play it, then save a copy of it to your Mac, there is a solution. After you’ve opened the audio file in its own window, right-click on the control bar to bring up the contextual menu. There you will see “download” and “download as” options. The latter allows you to rename the file and save it wherever you would like.

Somewhat confusingly, the contextual menu shows “download video”, even though it’s not a video file. However, my tests show that it properly appears as a playable mp3 file after I’ve downloaded it.

(Again, this is because the web page that Safari writes on the fly is invoking Safari’s built-in video-handling features. These features also work for audio files.)