What is the mime type for .log files? - mime-types

I am building a mime-type guesser and I am using the mimetype command to check my results. For log files it is returning text/x-log. I dont see this mime type on these lists:
http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/conf/mime.types?view=markup
https://www.iana.org/assignments/media-types/media-types.xhtml

According to this link, it is 'text/plain', hope that helps.
https://www.sitepoint.com/mime-types-complete-list/

Related

How to differentiate .odt and .docx file apart from magic number and extension

I need to detect the document type of the given file. I did it using magic numbers for pdf,RTF, doc files. but whenever I tried to do the same on odt and docx files, unfortunately, I can't because the magic number for both are same. Please help me to sort this issue. I need the answer programmatically in java
Thanks in advance.
What I just tried now :
$ file file.docx
file.docx: Microsoft OOXML
$ file file.odt
file.odt: OpenDocument Text

Unable to .show scores in Music21

I'm working in Jupyter Notebook. I've installed music21, musescore, set the xml path as below:
us = environment.UserSettings()
us['musicxmlPath'] ='Applications/musescore.app'
I've also run config, and see that musescore is being detected by music21. However, when I use the show method, I get the following error:
SubConverterFileIOException: png file of xml not found. Or file >999 pages?
Any help is appreciated. Thanks!
An .app file is a directory. Inside the MuseScore.app directory is a bin directory and a file called mscore -- that's the actual name in the path. It'd be much easier to run python -m music21.configure and let the automatic configuration program take care of it.
Are you sure that file is exist?
try changing 'Applications/musescore.app' to '/Applications/musescore.app'
Hope that helps
I found a answer from here wrote by GaetanBaert,It works well and now I can use show method.
He said that "you should change os.system(musescoreRun) line 891 of subconverters.py by subprocess.run(musescoreRun). You need also to import subprocess at the start of subconverters.py."

What mime type should I use for CSV ZIP files?

I am trying to send an email using Simple Java Mail API. The email will contain a CSV ZIP file attachment. Should I use text/csv or application/zip for the mime type of the attachment?
A zip file is a zip file, no matter what it contains.
It should be application/zip.
It is not a CSV file, if you tried to parse it as CSV it would fail. It is not text/csv.
In linux, you can find way much of the in the following file: /etc/mime.types.
See below to find out what mime is suitable for zip files.
grep zip /etc/mime.types
application/bacnet-xdd+zip xdd
application/epub+zip epub
application/gzip gz tgz
application/lpf+zip lpf
application/prs.hpub+zip hpub
application/tlsrpt+gzip
application/vnd.airzip.filesecure.azf azf
application/vnd.airzip.filesecure.azs azs
application/vnd.comicbook+zip cbz
application/vnd.d2l.coursepackage1p0+zip
application/vnd.dece.zip uvz uvvz
application/vnd.espass-espass+zip espass
application/vnd.etsi.asic-e+zip asice sce
application/vnd.etsi.asic-s+zip asics
application/vnd.exstream-empower+zip mpw
application/vnd.ficlab.flb+zip flb
application/vnd.gov.sk.e-form+zip
application/vnd.imagemeter.folder+zip imf
application/vnd.imagemeter.image+zip imi
application/vnd.iso11783-10+zip
application/vnd.laszip
application/vnd.logipipe.circuit+zip lcs lca
application/vnd.software602.filler.form-xml-zip zfo
application/vnd.stepmania.package smzip
application/zip zip
image/vnd.airzip.accelerator.azv azv
model/vnd.usdz+zip usdz
application/x-bzip2 bz2

jMimeMagic returning mime type for docx, pptx, jar files as application/zip

I read the mimetype for .docx file is application/vnd.openxmlformats-officedocument.wordprocessingml.document. But when I upload a .docx file(one that I just created, not from a zip file) and check for its mimetype in my application using
String mimeType = Magic.getMagicMatch(file1, false).getMimeType();
I get Mimetype as application/zip.
I get the same result when I try to upload a .jar file.
I mean this way, how can I check if the user is uploading a msword or a jar file to my application?
All of the .*x Office variants (.docx, .pptx, and so on) are XML-based content which is wrapped in a ZIP "container" to keep them compact, and your library is detecting the ZIP header correctly but then either not checking for, or failing to find, the additional information that would allow it to distinguish those from a ZIP file containing whatever random data someone put into it.
Similarly, the JAR file format is an extension of the ZIP file format, so if the library does not know to check for the "special type of ZIP" case, it would simply report it as a ZIP file.

What's the content type of a .ini file?

I'd like to make a dynamically generated .ini file available for download, is there a standardized value for the Content-Type of .ini files?
I've found some places saying it's text/plain, but I'm a bit dubious.
Checking with the IANA list of MIME Media Types shows us that .ini is not listed in the list of media types (and in particular, in the list of Text Media Types.)
Additionally, the Wikipedia entry on .ini files explains that .ini files are really just "simple text files."
One way to verify these findings is to run the following command on a given .ini file (in *nix, at least):
$ file --mime-type php.ini.default
which gives us the following result:
php.ini.default: text/plain

Resources