What is MIME type "image/x-djvu"?

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

image/x-djvu is the MIME type for the DjVu file format.
It is designed for scanned documents and image-heavy files. The format uses advanced compression to maintain high quality while reducing file size.
Files in this format include DJVU and DJV.
For more details, visit the DjVu Wikipedia page.

Associated file extensions

Usage Examples

HTTP Header

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


    Content-Type: image/x-djvu    
  

HTML

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


    <a href="file.dat" type="image/x-djvu">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', 'image/x-djvu');    
      res.end('Content here');    
    }).listen(3000);    
  

Associated file extensions

FAQs

Do web browsers support image/x-djvu natively?

No, most modern web browsers (Chrome, Firefox, Edge) do not support image/x-djvu out of the box. To view these files directly in a browser, you typically need a specific browser plugin or a JavaScript-based viewer like DjVu.js embedded in the webpage.

How do I configure Apache to serve DjVu files?

You can enable support by adding the MIME type definition to your .htaccess file or main configuration. Add the line AddType image/x-djvu .djvu .djv to ensure the server sends the correct headers for .djvu files.

What is the difference between image/x-djvu and image/vnd.djvu?

image/vnd.djvu is the official IANA-registered media type, while image/x-djvu is the older, experimental type that is still widely used for backward compatibility. Many servers and applications are configured to recognize the x- prefix, but using the standard vnd type is recommended for modern implementations.

Why use DjVu instead of PDF for scanned documents?

DjVu is specifically optimized for scanned images containing both text and pictures. It separates the document into layers (background, foreground, mask), allowing for extremely high compression ratios and smaller file sizes compared to standard PDF files, which makes it ideal for web-based digital archives.

How do I set up Nginx to handle the image/x-djvu MIME type?

Locate your mime.types file (usually in /etc/nginx/) and ensure it includes the definition. Add the line image/x-djvu djvu djv; inside the types block, then restart or reload Nginx to apply the changes.

How can I open a file with the image/x-djvu MIME type on my computer?

If you download a file sent as image/x-djvu, you will need a dedicated viewer. Popular standalone applications include WinDjView for Windows, DjView4 for Linux, and various reader apps available for macOS and mobile devices.

What usually causes a 'Download' prompt instead of displaying the DjVu file?

This happens if the web server sends the file with the Content-Disposition: attachment header or if the browser lacks a plugin to handle image/x-djvu. Without a plugin or a server-side JavaScript viewer, the browser defaults to downloading the binary file.

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.