Skip to content

PolarGoose/DirectoryOpus-FileMimeTypeAndEncodingColumns-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DirectoryOpus-FileMimeTypeAndEncodingColumns-plugin

This plugin adds two columns, "MIME type" and "Encoding" using UNIX file utility.
The plugin uses the content of a file and not its extension.
The screenshot below shows how the encoding and MIME type are correctly determined, even for files with incorrect extensions. Example

Extra Features

The plugin adds extra information to the MIME or Encoding columns:

  • Architecture of the dll or exe files
  • Dll or exe file is managed (.Net)
  • UTF-8 file has BOM

Prerequisites

You need to have file.exe utility installed on your system. The easiest way to get it is to install Git for Windows

Limitations

  • The script has to call file.exe for each file in the folder. Thus, it might be very slow for big folders.
  • UNC paths (paths that start with \\) and FTP paths are not supported - the MIME type column will be empty

How to use

  • Make sure file.exe is installed on your system
  • Download the js file from the latest release
  • Copy the js file to the %AppData%\GPSoftware\Directory Opus\Script AddIns folder
  • The extra columns will become available in the Settings->File Display Columns->Appearance->Columns:.
  • By default, the script uses the %ProgramFiles%/Git/usr/bin/file.exe path. If it is installed in a different folder, you need to change the script configuration in the Script management menu.
  • The script uses aliases for common MIME types. You can change them by modifying the mimeTypeAliases variable at the beginning of the script.

Portable DOpus use case

If you use a portable version of DOpus and you don't want to keep 'Git for Windows' installed on your system.
In that case, you can create a portable file.exe distribution:

  • Install Git for Windows on your system
  • Copy %ProgramFiles%/Git/usr/bin/file.exe, %ProgramFiles%/Git/usr/bin/*.dll and %ProgramFiles%/Git/usr/share/misc/magic.mgc to the same folder
  • Specify the path to file.exe and magic.mgc in the script configuration

About

MIME type and Encoding columns using 'file.exe' utility

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published