Questions tagged as 'mime-type'

2
answers

What are MIME types?

What are MIME types? And how important is it for rendering pages / files correctly? Is your use mandatory or depends on your browser? If not declared, can browsers behave differently at treatment time? Example: <script type='tex...
asked by 13.11.2015 / 13:25
3
answers

What content-type is suitable for files such as: .doc, .docx, .xls

What is the content-type suitable for files such as: .doc , .docx , .xls (general package files), .pdf , media files and other less common files such as Photoshop and AutoCAD ?     
asked by 07.12.2015 / 17:08
2
answers

Force text download in MSWord-supported format with PHP?

I would like to know how to force the download of a file, with some extension supported by Microsoft Word p> I've searched a few times, tested the MIME types I found, like the ones in this Microsoft's list , but I did not succeed. This...
asked by 11.09.2015 / 07:13
1
answer

Set MIME-type of a file on Android

I need to dynamically find out what the MIME-type of a file is. Initially, I only need to identify videos, but I intend to use this to identify HTML pages, photos, PDF etc.     
asked by 29.06.2017 / 14:17
1
answer

How to find out the file extension through the Bytes array?

I wonder if it is possible to give a get in the file extension through the Bytes Array. Well, I downloaded a file from the server, and it can be either .JPEG or .EPS, but I'm not able to know what file I got and I can not set the MIME / Extensio...
asked by 26.12.2017 / 17:30
1
answer

Is it dangerous to leave mod_mime_magic active in Apache?

I was once arguing with a more experienced programmer than myself (the user @Bacco ) about uploading files. I was commenting with it it did not make sense for someone to try uploading a file with jpg extension having in the content a...
asked by 18.10.2016 / 13:19
3
answers

How to get the mime of a file through Python?

How can I get Mimetype from a file via Python? I'm not just talking about getting through the extension, but also reading the file metadata. How can I do this? Note : I tried to use python-magic on Windows but it did not work....
asked by 27.06.2017 / 15:05
1
answer

Block upload of .gif images renamed with .jpg or .png in PHP

I have an upload system where the user can only upload images with .jpg or .png extension. Here's part of the code: $imagemNomeAntes = $_FILES["the_image"]["name"]; $imagemNomeAntesExt = basename($imagemNomeAntes); $imagemNomeExt = pathinfo($i...
asked by 09.07.2015 / 00:25
1
answer

What is the correct MIME type?

In order to allow data to be exchanged between the server and the browser, a number of means are usually adopted, for example when returning an existing dataset in the database using JSON . There are these here: application / json appl...
asked by 17.10.2015 / 02:12
1
answer

Use finin or pathinfo to get the mime type?

finfo_* and pathinfo are used to detect the mimetype of the file and not the extension. The issue is that in the world there are several file formats and from time to time new formats appear, I can not do a test to know wh...
asked by 27.05.2015 / 02:10