Which MIME types are related to file extension ".dfm"?
The .dfm file extension is associated with 3 MIME types:
text/x-pascal, text/plain, application/octet-stream.
A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.
About .dfm Files
DFM files are form definition files used by Borland Delphi and C++ Builder to design graphical interfaces.
They store the layout, properties, and event details of a form.
They can be saved as human‐readable text or as a binary file, depending on settings.
- Main use case: Defining user interface components and their properties in Delphi projects.
- MIME types: text/x-pascal and text/plain indicate a text-based format, similar to Pascal code, while application/octet-stream is used for a binary version.
- Software: Open these files using the Delphi IDE, C++ Builder, or even a basic text editor for the text version.
Relationship between file extension and MIME type
A file extension is a suffix at the end of a filename that indicates what type of file it is. File extensions help both users and operating systems identify what application should be used to open the file.
File extensions are typically separated from the filename by a period (dot) and consist of 2-4 characters, though they can be longer. For example, in the filename "document.pdf", ".pdf" is the file extension.
File extensions are closely related to MIME types, as they both serve to identify the format of a file. However, while MIME types are used primarily by web browsers and servers, file extensions are used by operating systems and applications.
Associated MIME types
text/x-pascal, text/plain, application/octet-stream
FAQs
What is a DFM file?
A DFM file (Delphi Form) is a settings file used by Borland Delphi and C++ Builder to store the visual structure of a window or form. It defines the properties of components, such as buttons and text boxes, including their positions, captions, and associated event handlers.
How do I open a DFM file?
You should open DFM files using the Delphi IDE or C++ Builder to view the visual form designer. If the file is saved in the text format, you can also view and edit the raw code using standard text editors like Notepad, Notepad++, or Visual Studio Code.
Why does my DFM file look like unreadable symbols?
If your DFM file looks like gibberish in a text editor, it is saved in a binary format. While the Delphi IDE can read this natively, you cannot edit it manually with a text editor unless you convert it to the text-based format first.
How can I convert a binary DFM file to text?
You can use the command-line utility convert.exe located in the Delphi bin folder to toggle between binary and text formats. Alternatively, inside the Delphi IDE, you can right-click on the form designer and select Text DFM to ensure the file saves as human-readable text.
What is the relationship between .DFM and .PAS files?
These files usually exist in pairs: the .pas file contains the Pascal source code (logic) for the form, while the .dfm file contains the visual design (GUI). Deleting or renaming one without updating the other will usually break the project compilation.
What MIME type is associated with DFM files?
Text-based DFM files are often associated with text/plain or text/x-pascal due to their similarity to Pascal code. Binary versions are classified as application/octet-stream. For more details on these content types, visit mime-type.com.
General FAQ
What is a MIME type?
A MIME (Multipurpose Internet Mail Extensions) type is a standard that indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.
MIME types are important because they help browsers and servers understand how to process a file. When a browser receives a file from a server, it uses the MIME type to determine how to display or handle the content, whether it's an image to display, a PDF to open in a viewer, or a video to play.
MIME types consist of a type and a subtype, separated by a slash (e.g., text/html, image/jpeg, application/pdf). Some MIME types also include optional parameters.
How do I find the MIME type for a file?
You can check the file extension or use a file identification tool such as file --mime-type on the command line. Many programming languages also provide libraries to detect MIME types.
Why can one extension have multiple MIME types?
Different programs and historical usage may assign various MIME identifiers to the same file format. Listing them together helps maintain compatibility across tools.