Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Why does Firefox prompt me to save/open image files that are above a certain file size rather than simply display the image in its tab?

more options

I Uploaded several jpg images to GitHub of various file-sizes using a command line tool called Upgit:

Image 1: https://raw.githubusercontent.com/futuremotiondev/general-storage/refs/heads/main/WallpapersTest3/aesthetic-black-wallpaper-download-full-6.jpg

Image 2: https://raw.githubusercontent.com/futuremotiondev/general-storage/refs/heads/main/WallpapersTest3/aesthetic-black-wallpaper-for-pc-4.jpg

Image 3: https://raw.githubusercontent.com/futuremotiondev/general-storage/refs/heads/main/WallpapersTest3/alexander-popov-Vy2Bttl96_E-unsplash.jpg

Image 4: https://raw.githubusercontent.com/futuremotiondev/general-storage/refs/heads/main/WallpapersTest3/anders-jilden-AkUR27wtaxs-unsplash.jpg

Image 5: https://raw.githubusercontent.com/futuremotiondev/general-storage/refs/heads/main/WallpapersTest3/andre-benz-cXU6tNxhub0-unsplash.jpg

Notice that if you open image 5, it prompts to save it or open it in an external application (or just downloads it, depending on your download settings). All the other images just simply load and appear in their tabs.

Is there a configuration setting in about:config that determines the file size threshold for this behavior?

Try it yourself: Open image 5. It will prompt you or download the image automatically whereas the other images just display in tabs.

How can I disable this behavior?

Any help greatly appreciated.

I Uploaded several jpg images to GitHub of various file-sizes using a command line tool called Upgit: Image 1: https://raw.githubusercontent.com/futuremotiondev/general-storage/refs/heads/main/WallpapersTest3/aesthetic-black-wallpaper-download-full-6.jpg Image 2: https://raw.githubusercontent.com/futuremotiondev/general-storage/refs/heads/main/WallpapersTest3/aesthetic-black-wallpaper-for-pc-4.jpg Image 3: https://raw.githubusercontent.com/futuremotiondev/general-storage/refs/heads/main/WallpapersTest3/alexander-popov-Vy2Bttl96_E-unsplash.jpg Image 4: https://raw.githubusercontent.com/futuremotiondev/general-storage/refs/heads/main/WallpapersTest3/anders-jilden-AkUR27wtaxs-unsplash.jpg Image 5: https://raw.githubusercontent.com/futuremotiondev/general-storage/refs/heads/main/WallpapersTest3/andre-benz-cXU6tNxhub0-unsplash.jpg Notice that if you open image 5, it prompts to save it or open it in an external application (or just downloads it, depending on your download settings). All the other images just simply load and appear in their tabs. Is there a configuration setting in about:config that determines the file size threshold for this behavior? Try it yourself: Open image 5. It will prompt you or download the image automatically whereas the other images just display in tabs. How can I disable this behavior? Any help greatly appreciated.

All Replies (4)

more options

This is related to how the server is characterizing the content in the Response Headers:

Image 3: Content-Type: image/jpeg

Image 4: Content-Type: image/jpeg

Image 5: Content-Type: application/octet-stream

Is this the Upgit you're using: https://github.com/pluveto/upgit

Based on a very cursory search of the source, it seems to base the Content-Type on the mimeType determined from the file extension, with application/octet-stream as the fallback. I didn't spend enough time on it to know where the problem is.

Helpful?

more options

jscher2000 - Support Volunteer said

Is this the Upgit you're using: https://github.com/pluveto/upgit

Yes.

jscher2000 - Support Volunteer said

Based on a very cursory search of the source, it seems to base the Content-Type on the mimeType determined from the file extension, with application/octet-stream as the fallback. I didn't spend enough time on it to know where the problem is.

I'm not sure why that would happen as they are all the same file extension and file format (.jpg/.jpeg). I've tested this out more in the last 30 minutes or so and I'm able to reproduce if the files uploaded are above about 5MiB or so (I haven't determined the exact size), then I get prompted to download the image instead of the image displaying. It doesn't matter what image format I upload nor file extension. I've tried PNG/WebP/JPEG/JPG and I'm pretty confident there is a threshold where if the file size is above a certain amount you get the prompt.

Do you know more about why a larger image file would be handled as application/octet-stream rather than it's proper mimeType?

Thanks for any further information.

Edit: I seem to recall a setting in about:config that controls a delay period for determining the content type of a resource, but I can't remember what it is. I did a bit of tweaking in about:config when I first set up firefox and I'm wondering if a setting I changed is causing this. Can you confirm that you're getting the same behavior on a firefox profile without any about:config changes?

Modified by Jay S

Helpful?

more options

For some reason the response I just posted to your reply got deleted - not sure why.

jscher2000 - Support Volunteer said

This is related to how the server is characterizing the content in the Response Headers: Is this the Upgit you're using: https://github.com/pluveto/upgit

Yes, that's the app.

jscher2000 - Support Volunteer said

Based on a very cursory search of the source, it seems to base the Content-Type on the mimeType determined from the file extension, with application/octet-stream as the fallback. I didn't spend enough time on it to know where the problem is.

I've been able to reproduce the issue with all sorts of different image files and the common denominator is file size. It appears any image file above ~5MiB or so (I don't know the exact size) causes this to happen. I've tried JPG/JPEG/PNG/WEBP images and they all elicit the same behavior if their file size is large.

Regarding the mimeType being determined from the file extension - that doesn't seem to align with what I'm seeing as I test this. It happens with all different file extensions. Do you know why the fallback to application/octet-stream would occur?

Thanks for any further help.

Helpful?

more options

I'm assuming this is on Github's side, but I can't seem to find any documentation. Maybe the developer of Upgit has some insight into it.

Helpful?

Ask a question

You must log in to your account to reply to posts. Please start a new question, if you do not have an account yet.