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.
An . INI file is a type of file that contains configuration information in a simple, predefined format. It is used by Windows OSs and Windows-based applications to store information about the user's preferences and operating environment.
The INI file consists of sections and keys. The name of a section in the *. ini file is always entered inside the square brackets. Each section contains several keys (the key must be always assigned to the section that begins in the file before this key).
How to Open and Edit INI Files. It's not a common practice for people to open or edit INI files, but they can be opened and changed with any text editor. Just double-clicking it will automatically open it in the Notepad application in Windows.
For detecting MIME-types, use the aptly named "mimetype" command. It has a number of options for formatting the output, it even has an option for backward compatibility to "file". But most of all, it accepts input not only as file, but also via stdin/pipe, so you can avoid temporary files when processing streams.
Common INI Filenames. desktop.ini - A hidden file located in Windows folders that saves viewing options for that specific folder. This file can specify an image that is used for the folder icon as well as appearance options for files within the folder.
PHP uses the INI format for its " php.ini " configuration file in both Windows and Linux systems. [5] [6] Desktop.ini files determine the display of directories in Windows, e.g., the icons for a directory. [7] The following example file has two sections: one for the owner of the software, and one for a payroll database connection.
INI file. Linux and Unix systems also use a similar file format for system configuration. In addition, platform-agnostic software may use this file format for configuration. It is human-readable and simple to parse, so it is a usable format for configuration files that do not require much greater complexity.
The program or operating system that's using the file will only recognize it under the specific name and file extension that it's using. However, since INI files are just regular text files, you can use a program like Notepad++ to save it to another text-based format like HTM/HTML or TXT.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With