搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

When downloading xmp files, they are changed to xml

more options

I download xmp files from https://discuss.pixls.us. Starting about mid-day today, when I clicked on a file to download it, the extension was changed to xml. I didn't change any settings. There might have been an update of Firefox.

I download xmp files from https://discuss.pixls.us. Starting about mid-day today, when I clicked on a file to download it, the extension was changed to xml. I didn't change any settings. There might have been an update of Firefox.

由 broccoli.salad.soup 於 修改

被選擇的解決方法

Thank you for the example. It appears Firefox is peeking at the start of the file, which is

<?xml version="1.0" encoding="UTF-8"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 4.4.0-Exiv2">


I suspect this is because the server is not sending a Content-Type header with the file (according to the first attached screenshot, from Firefox's Browser Console):

Perhaps the site could be persuaded to reconfigure their web serving software. Does the forum have a place to raise this issue?

If a change like that doesn't come quickly enough, would you consider using an add-on for this? I have an extension called Content-Type Fixer that checks the file extensions of downloads and lets you override the Content-Type. Here's how you would set that up for these files:

(1) Install the extension: https://addons.mozilla.org/firefox/addon/content-type-fixer/

(2) Click its Zzzz button to start it

(3) Trigger the download (you can cancel after you get the dialog)

(4) Click the toolbar button again to open the menu, then "Add/Edit Content Types (View Log)"

(5) Near the top of the log, find the problem download, and click its "Add" button

(6) I don't think there is an official MIME type for these files, so you can simply keep the suggested ficitious MIME type and click Save Content-Type

(7) Switch to your tab with the link and try the download again -- the dialog should look more like the second attachment:

Success? That should continue while the extension is "awake" (if you need to go back to the built-in handling, you can disable the overriding from the menu or turn off the extension).

從原來的回覆中察看解決方案 👍 1

所有回覆 (10)

more options

You can inspect the MIME database key with the registry editor (regedit.exe) and do a search for that MIME type (file extension) via Ctrl+F. Be cautious with editing the registry as there is NO UNDO possible: all changes are applied immediately. You can export key(s) in the registry editor before making changes.

You can check specific file extension keys (e.g. .xml) in the registry with the registry editor.

  • HKEY_CLASSES_ROOT\.xxx

You can check a possibly linked MIME type in the MIME Database registry key.

  • HKEY_CLASSES_ROOT\MIME\Database\Content Type\
more options

I searched for xmp and found xmpp/xml. As for editing, I have no idea what I would do.

more options

Windows didn't update between yesterday and today, but I believe I restarted Firefox and there was an update and eventually I noticed the behavior. What would Firefox have done?

more options

I tried with Edge; it didn't change the extension, so it is Firefox.

more options

You can check the .xmp key and a linked MIME type like I posted above and make sure that the file extension is .xmp and not .xml in the linked MIME type.

  • HKEY_CLASSES_ROOT\.xmp
  • HKEY_CLASSES_ROOT\MIME\Database\Content Type\
more options

What kind of file is a .xmp and can you provide a more direct way to find one as an example?

I'm asking because we recently had a report that Firefox 84 changes .story file extensions to .zip when a server identifies the Content-Type (MIME type) of the file as "application/zip".

So it could be interesting to check whether the sites you download from are identifying the Content-Type of the .xmp file as "application/xml" in case this is part of a pattern of Firefox modifying file extensions to match their content types.

Note: if you share a link to a non-Mozilla site, your reply will be temporarily diverted to a moderation queue, which was instituted after scammers starting replying here. Your post will appear eventually.

more options

An xmp is a darktable sidecar file; it contains all the editing information for a photo. An example of where I would download one is https://discuss.pixls.us/t/playraw-tree-in-park/20938.

more options

cor-el: I don't find xmp in either of those locations.

more options

選擇的解決方法

Thank you for the example. It appears Firefox is peeking at the start of the file, which is

<?xml version="1.0" encoding="UTF-8"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 4.4.0-Exiv2">


I suspect this is because the server is not sending a Content-Type header with the file (according to the first attached screenshot, from Firefox's Browser Console):

Perhaps the site could be persuaded to reconfigure their web serving software. Does the forum have a place to raise this issue?

If a change like that doesn't come quickly enough, would you consider using an add-on for this? I have an extension called Content-Type Fixer that checks the file extensions of downloads and lets you override the Content-Type. Here's how you would set that up for these files:

(1) Install the extension: https://addons.mozilla.org/firefox/addon/content-type-fixer/

(2) Click its Zzzz button to start it

(3) Trigger the download (you can cancel after you get the dialog)

(4) Click the toolbar button again to open the menu, then "Add/Edit Content Types (View Log)"

(5) Near the top of the log, find the problem download, and click its "Add" button

(6) I don't think there is an official MIME type for these files, so you can simply keep the suggested ficitious MIME type and click Save Content-Type

(7) Switch to your tab with the link and try the download again -- the dialog should look more like the second attachment:

Success? That should continue while the extension is "awake" (if you need to go back to the built-in handling, you can disable the overriding from the menu or turn off the extension).

more options

Thank you very much, jscher2000. I will follow both of your suggestions; in fact, I opened a topic on the site asking if anyone else was having the problem, and someone replied. I will point them toward your answer and see what happens. In the meantime, I will install your add-on.