I am trying to get my Apache2 web application to push an arbitrary file extension as an octet-stream when pointed to by a browser.
i.e. Someone goes to blahblah/examples/example1.xyz I want the browser to download the .xyz file rather than just display it.
I have tried adding .htaccess in the root of the web app including
Why does the FindMimeFromData function from Urlmon.dll return MIME type “application/octet-stream” for many file types, whereas checking MIME type by file extension (I.e. against windows registry) returns a more precise type?
For example, mp3 is an “application/octet-stream” instead of “audio/mp3”.
Basically, I want to verify an uploaded file wit
Super baffled by this problem. Everything is working great local but when I deploy to Heroku it hits this error:
Bundler could not find compatible versions for gem "mime-types":
rails (= 3.2.17) ruby depends on
mime-types (~> 1.16) ruby
stripe (>= 0) ruby depends on
I've tried gem installing mime-types 2.3 bot
I am looking for a simple way to get a mime type where the file extension is incorrect or not given, something similar to this question only in .Net.
Solution In Urlmon.dll, there's a function called FindMimeFromData.
From the documentation
MIME type detection, or "data sniffing," refers to the process of determining an appropriate MIME type
When working with PDFs, I've run across the MIME types application/pdf and application/x-pdf among others.
Is there a difference between these two types, and if so what is it? Is one preferred over the other?
I'm working on a web app which must deliver huge amounts of PDFs and I want to do it the correct way, if there is one.
Solution The stand
so I have a standard <input type="file" accept="..."/> where the accept, is a large list of different mime types. I already verify the filetypes on the server backend but I want to be sure I am not filtering out valid files on the clients UI. I realise older browsers will not filter files at all, this is fine. My concern is that a modern brow
Is there a way to use intent.setType() and supply multiple broad types (like images and video)?
I am using an ACTION_GET_CONTENT. It seems to be working with just comma-separated types.
Solution Actually, multiple mime-types are supported. Have you even tried it???
For example: intent.setType("image/*,video/*") will display photos and videos...
As per https://developers.google.com/drive/manage-uploads, it mentions
See the API reference for each method's list of accepted mime types and size limits for uploaded files.
I was unable to find mime type listing at https://developers.google.com/drive/v2/reference/
Where can I find it?
Solution Sorry it isn't listed in the documentation. It is
The FindMimeFromData method accessible through Windows DLL Urlmon.dll is capable of determining the MIME type of a given data stored in memory, considering the first 256 bytes of the byte array, where such data is stored.
However after reading it's documentation, I was lead to MIME Type Detection in Windows Internet Explorer where I could find the
I keep getting this warning
Resource interpreted as Font but transferred with MIME type application/octet-stream: "http://127.0.0.1:8080/assets/font/fontawesome-webfont.woff".
I am using Play 2.0.4 webserver. I added the mime-types to my application.conf file as follows
mimetype.eot = application/vnd.ms-fontobject
mimetype.otf = application/oct