ARTIFACTORY: How to Enable Web UI View/Preview for Custom File Extensions (e.g., .vsixmanifest) in Artifactory
Problem StatementBy default, Artifactory maps known file extensions to specific MIME types, which determine whether a file can be viewed/previewed directly within the Artifactory Web UI as text or syntax-highlighted content.Files with custom or unmapped extensions (such as `.vsixmanifest` used in Visual Studio extensions) might not have the "View" option available in the UI by default. This article explains how to configure `$JFROG_HOME/artifactory/var/etc/artifactory/mimetypes.xml` to add support for `.vsixmanifest` (or any custom XML-based extension) to be viewed directly from the Artifactory UI.
Solution
Step 1: Locate or Create `mimetypes.xml`-
Navigate to the Artifactory configuration directory:Shellcd $JFROG_HOME/artifactory/var/etc/artifactory/
Step 2: Edit `mimetypes.xml`
-
Open `mimetypes.xml` in your preferred text editor. -
Locate the existing `application/xml` definition. For example:XML<mimetype type="application/xml" extensions="xml, xsl, xsi" viewable="true" syntax="xml" css="xml"/>
-
Append `vsixmanifest` to the `extensions` attribute list and ensure `viewable="true"` and `syntax="xml"` are set:XML<mimetype type="application/xml" extensions="xml, xsl, xsi, vsixmanifest" viewable="true" syntax="xml" css="xml"/>
-
Save and close the file.
Step 3: Set Correct File Permissions (Linux)
Ensure the `artifactory` user owns the modified file:Shell
chown artifactory:artifactory $JFROG_HOME/artifactory/var/etc/artifactory/mimetypes.xml chmod 640 $JFROG_HOME/artifactory/var/etc/artifactory/mimetypes.xml
Step 4: Restart Artifactory
For the updated MIME type mappings to take effect across the node/cluster, restart the Artifactory service:-
Systemd / Service:Shellsystemctl restart artifactory.service
-
HA Deployments: Apply the changes and restart each Artifactory node in the cluster.
Verification
-
Log in to the Artifactory Web UI. -
Navigate to Platform > Artifactory > Artifacts. -
Locate any repository containing a `.vsixmanifest` file. -
Right-click the `.vsixmanifest` file or select it in the tree browser. -
Confirm that the View option is now available and displays the file content with XML syntax highlighting.