1

On Linux / Unix Command file:

" -i Causes the file command to output mime type strings rather than the more traditional human readable ones "

Why does it always output "application/octet-stream" for images and videos? How can I obtain the specific mime type of an image or a video with this command or with any other command?

Thanks.

Lucia
  • 145
  • 1
  • 7

2 Answers2

0

Can you tell us what the output is with out the -i switch?

Also, what is the output of the file --version, maybe you are missing magic files?

file --version
file-4.26
magic file from /etc/magic:/usr/share/file/magic

You might just need to update your magic package (I love how these sentances sound :-) ). Do so on debian / ubuntu :

apt-get install libmagic1
Kyle Brandt
  • 83,619
  • 74
  • 305
  • 448
0

Experienced similar under Ubuntu 9.10 while it was working in Ubuntu 9.04.

Had libmagic1 and libmagic-dev installed with the following:

$ file --version
file-5.03
magic file from /etc/magic:/usr/share/misc/magic

/etc/magic has only a couple comments (in 9.10 and 9.04)
/usr/share/misc/magic is a symlink to ../file/magic

I managed to solve the problem by downgrading file and libmagic. I installed these versions from Jaunty:

  • libmagic1_4.26-2ubuntu3_amd64.deb
  • file_4.26-2ubuntu3_amd64.deb

Things seem to be working now, but I don't know if it'll cause other issues.

random
  • 450
  • 1
  • 9
  • 16