InsideDarkWeb.com

css files are reported as text/plain by mimetype on ubuntu machine

When I run the following command
mimetype -DM --database /usr/share/misc/magic /path/to/reset.css
I expect to see text/css as a result but instead I get text/plain. Is there a way to fix this?

EDIT
Removing -M didn’t change anything

[email protected] /var/www/vhosts/zf2skeleton # mimetype -D --database /usr/share/misc/magic module/Application/public/css/bootstrap.min.css 
> Data dirs are: /usr/share/misc/magic
> Checking inode type
WARNING: You don't seem to have a mime-info database. The
shared-mime-info package is available from http://freedesktop.org/ .
> Checking globs for basename 'bootstrap.min.css'
> Checking for extension '.min.css'
> Checking for extension '.css'
> File exists, trying default method
module/Application/public/css/bootstrap.min.css: text/plain

Server Fault Asked on November 14, 2021

1 Answers

One Answer

The manpage you linked to says it looks in the following locations for the database:

$HOME/.local/share/mime
/usr/local/share/mime
/usr/share/mime

You can maybe figure out how to add an entry for CSS by looking at those directories.

After updating you have to run update-mime-database

EDIT:

You're using the -M switch which means it won't look at the file extension. It will look at the contents of the file only. A CSS file doesn't have a consistent header though so I doubt that will work.

Answered by sjbotha on November 14, 2021

Add your own answers!

Related Questions

Heroku.yml is not getting bash script

0  Asked on December 29, 2020 by shahrear-bin-amin

   

D-Link DGS-1210-28 factory reset

0  Asked on December 27, 2020 by andrey-salnikov

       

Install Linux on a second disk from an already running Linux (RHEL 7.8) instance

0  Asked on December 27, 2020 by alittlestitiouspuppet

         

Can haproxy log unknown headers?

2  Asked on December 26, 2020 by cbaltatescu

   

SSH: Behavior of SetEnv for TERM variable

1  Asked on December 26, 2020 by lazarus535

   

Turn off a check on one host in icinga2

2  Asked on December 25, 2020 by peter-nunn

 

srv records in a Samba AD

0  Asked on December 25, 2020 by user219279

     

Ask a Question

Get help from others!

© 2021 InsideDarkWeb.com. All rights reserved.