Safari adds .html extension to common downloads

Zip files, pdf's - not all but some - (may apply to other files I've not found yet)

file.zip (contains a PDF, some other documents) - will be file.zip.html
maps.pdf (just a pdf on a winbox, opens normally) - gets tagged maps.pdf.html

Any way of losing the .html extensions so I don't have to do it by hand each time it happens?

Thanks

Imac/8800gs/4GB/1TB, Mac OS X (10.5.6), Saf. 3.2.1

Posted on Jan 14, 2009 8:44 PM

Reply
5 replies

Jan 16, 2009 4:02 PM in response to iBod

Thanks for pointing that out -

I see the problem as Safari is reading it, Firefox reads the element as a link that will open in the same window.

Guess since it's opening in the same window the header

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

is being interpreted by Safari as the content type. Kinda not understanding why Safari and Firefox are reading the same thing, but the file gets handed off to Firefox correctly.

Minor issue tho... anyhow, thanks again.

Jan 16, 2009 4:10 PM in response to SteveCG

Hi,

It's not part of the webpage that determines the content type of the download. That's a separate configuration setting on the server side.

The code you posted is for the webpage the links are present on.

When the link is clicked on the server, the server sends the headers I mentioned in my previous post to the browser indicating the type of content to expect. The 'content-disposition:' part also means that the browser shouldn't try and display the data in the browser but allow the user to save it.

Technically, Safari is doing what it is told correctly. Unfortunately, there are quite a few mis-configured web servers out there.

Send feedback to Apple about this via Safari menu > Report bugs to Apple... You're not the first to question this behaviour, and you won't be the last 😉

Jan 15, 2009 2:33 AM in response to SteveCG

Hi,

That's usually caused by the web server the files are hosted on misidentifying the MIME type of the file (probably as text/html). Can you post an example link to a file you have this problem with?

Other web browsers seem to have enough 'smarts' to ignore the MIME type for certain types of files, whereas Safari will just follow what the web server is incorrectly telling it.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Safari adds .html extension to common downloads

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.