Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Safari Adds Extra ".html" to Downloaded Files

Is there a way to keep Safari from adding the suffix ".html" to files I download that already have the right suffix, like jpg, mov, etc.?

I am using iPower to host my web page. On their file manager page, I can access files that the public uploads at my site. When I click their download button, however, Safari adds an extra ".html" to files that already have the right suffix. So, for example, a file correctly named "Picture.jpg" in the file manager gets downloaded to my desktop as "Picture.jpg.html".

This only happens in Safari. It does not happen in Firefox, or on Windows Explorer or Windws Firefox.

I know I can just delete the extra .html (and then suffer the dialog box that asks if I'm sure), but it's annoying.

What's going on? Any fixes?

24" Intel iMac 2.8; 15" MacBook Pro 2.66 G5 1.8, PB G4; G3, Mac OS X (10.5.7)

Posted on May 28, 2009 12:25 PM

Reply
15 replies

May 28, 2009 1:57 PM in response to Richard Setterberg

Hi,

What's going on? Any fixes?


Without seeing the site, I can't be 100% certain, but it's very likely that the webserver you're hosted on is not correctly setting the MIME types for these file types.

Safari respects what the webserver tells it, whereas Firefox and IE are a tad more 'pragmatic' and ignores the webserver.

If you can post a link to an example problem file then I can confirm/deny that idea.

May 28, 2009 2:50 PM in response to iBod

Yes, that's my point. The link I provided was exactly what resulted when I downloaded the jpg from my web server using Safari. On the server it appeared as "Picture.jpg." When I downloaded it to my desktop, it was in the form "Picture.jpg.html." Safari added the "html" during the download process. No other browser I have access to does this. I've since added a picture of what the server page and desktop looks like on the page represented by the link above.

For what it's worth, the iPower guys say it's a Safari issue, not theirs.

Message was edited by: Richard Setterberg

May 28, 2009 3:02 PM in response to Richard Setterberg

The [original picture link|http://www.setterberglaw.com/uploads/page2/assets/Max3.jpg] you added looks correct. The MIME type is returned as 'image/jpeg' for that.

For the original file you posted (with the pre-existing .html extension) the MIME type is set to 'text/html' which is technically correct for a html document, but as you say, it's really a jpg image.

May 28, 2009 3:19 PM in response to iBod

You're right; I probably have missed your point and wasn't very clear. I attached the downloaded file to show you what I got, not what I started with.

Let me try again.

I set up an upload page on my website. I am using RapidWeaver and a plugin called RapidUpload. The upload page appears in the link I sent.

To test how it works, I sent my site a file using the upload page.

I then went to the iPower web server site to get the file I sent. I go to place where the uploads are kept, and it has the file. In my Safari browser window, the file appears as "Max3.jpg." A screen shot of another photo showing what the iPower file manager page looks like is at the site link.

There is a downward arrow on the iPower site to the right of the file. This is the download icon. When I click on that icon, it downloads the file to my desktop. However, in the process of doing this, it adds an unnecessary and unwanted ".html" to the downloaded file name. The resulting file on the desktop also appears on the screen shot I provided.

I want to know what I can do to Safari to stop it from doing this. I say "do to Safari" because if I use Firefox or Explorer to download the file to the desktop, this extraneous ".html" does not get added.

May 28, 2009 3:28 PM in response to Richard Setterberg

Hi again,

I'd still wager it's the MIME type setting on the server that's causing this.

Can you right-click on the Download arrow and choose to copy the link address to the uploaded image? After that, open a Terminal window (Applications > Utilities > Terminal) and type:


curl -I <link address from the download arrow>


That will show the headers the server is sending to the browser about the file. It should say 'image/jpeg' or 'image/jpg'. If it says 'text/html' then that's what Safari is respecting.

May 28, 2009 3:55 PM in response to Richard Setterberg

OK, one more try then.

After clicking the download arrow in the site manager, the picture download should appear in the Safari Downloads window. Control-clicking that should give you an option to copy the address to the file. Try using that with the curl command to see what it gives you.

If it's in a password protected area then curl may well show a 404/403 error of course 🙂

May 28, 2009 4:17 PM in response to iBod

It looks to me like you're right. The terminal text reads:

Last login: Thu May 28 19:09:23 on ttys000
Divemaster-2:~ user$ curl -I http://www.ipower.com/controlpanel/FileManager/m.cmp?cmd=dlfile&p=public_html%2F RapidUpload%2FMax1.jpg
[1] 13901
Divemaster-2:~ user$ HTTP/1.1 302 Found
Date: Thu, 28 May 2009 23:13:00 GMT
Server: Apache
Set-Cookie: request_uri=http://www.ipower.com/controlpanel/FileManager/m.cmp%3fcmd%3ddlfile ; domain=ipower.com; path=/
Location: https://secure.ipower.com/secure/login.bml?err=
Content-Type: text/html; charset=iso-8859-1





I guess I'll have to go back to iPower and see what they say. There is no question that the content type shows as "text/html".

I'll report back. Thanks for all your efforts.

Message was edited by: Richard Setterberg

May 28, 2009 5:10 PM in response to Richard Setterberg

Hi Richard,

I think that is actually correct in this case. The header message is indicating that the file is not publically accessible and is redirecting you to the login page (which is text/html).

I'd still chase up with the iPower folks though to see if they can double check the MIME type settings the site manager is using for the download functionality.

May 29, 2009 2:59 PM in response to iBod

As I kind of expected, the support person at iPower continues to claim it's Safari's problem:

"I have checked the URL http://discussions.apple.com/thread.jspa?messageID=9532567&#9532567 and was able to duplicate the issue. The MIME types of already there on our server. Since the issue is with your Safari browser, I suggest that you contact Apple to resolve your issue."

I wish I didn't have another reason to use Firefox--for this purpose at least -- but that's where I think I am.

Thanks everyone for your help.

Safari Adds Extra ".html" to Downloaded Files

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