What is MIME type "application/x-apple-diskimage"?

A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.

application/x-apple-diskimage is the MIME type for Apple disk image files.
These files store a complete copy of a diskโ€™s contents. They act as a secure container for data, operating systems, or applications.
They are used by files like DMG, IMG, IMAGE, SMI, and 2MG.
This format is important for distributing applications safely on Apple systems.
For more technical details, see Wikipedia on Disk Image.

Associated file extensions

Usage Examples

HTTP Header

When serving content with this MIME type, set the Content-Type header:


    Content-Type: application/x-apple-diskimage    
  

HTML

In HTML, you can specify the MIME type in various elements:


    <a href="file.dat" type="application/x-apple-diskimage">Download file</a>    
  

Server-side (Node.js)

Setting the Content-Type header in Node.js:


    const http = require('http');    
    
    http.createServer((req, res) => {    
      res.setHeader('Content-Type', 'application/x-apple-diskimage');    
      res.end('Content here');    
    }).listen(3000);    
  

Associated file extensions

FAQs

How do I configure Apache to serve DMG files correctly?

To ensure Apache serves Apple Disk Images with the correct MIME type, add the following line to your .htaccess file or server configuration: AddType application/x-apple-diskimage .dmg. This helps browsers and download managers identify the file as a specific disk image rather than a generic binary stream.

Can Windows browsers open application/x-apple-diskimage files?

No, Windows browsers will simply download the file because the operating system does not natively support mounting Apple Disk Images. To view the contents on Windows, users typically need third-party software like 7-Zip or TransMac to extract files from the .dmg container.

What is the difference between application/x-apple-diskimage and application/octet-stream?

application/octet-stream is a generic fallback type for unknown binary files, whereas application/x-apple-diskimage specifically identifies the file as an Apple Disk Image. Using the specific MIME type is better for client-side handling and security, ensuring the browser understands the file is intended for macOS mounting.

How do I add support for this MIME type in Nginx?

In your nginx.conf or mime.types file, add the directive mapping the extension to the type. The entry should look like: application/x-apple-diskimage dmg;. After saving the file, reload Nginx to apply the changes for your .img or .dmg files.

Why does the MIME type start with 'x-'?

The x- prefix stands for "experimental" or "extension," indicating that application/x-apple-diskimage is not a standard registered with IANA. However, it is the widely accepted convention for serving Apple Disk Images across the web and is recognized by almost all modern browsers and operating systems.

Are files served with this MIME type secure?

The MIME type itself is just a label, but the files (usually .dmg) are containers that can hold executable software. While useful for legitimate software distribution, they can store malware. macOS uses features like Gatekeeper to verify the digital signature of applications contained within these images before allowing them to run.

Does Safari handle this MIME type differently than Chrome?

Yes, on macOS, Safari may automatically verify and mount the disk image after downloading if the "Open safe files after downloading" setting is enabled. Chrome and Firefox will typically just download the file to the user's specified folder, leaving the user to manually double-click and mount the image.

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 are multiple MIME types listed for one extension?

Different applications and historical conventions may use alternative MIME identifiers for the same kind of file. Showing them all helps ensure compatibility across systems.