Hello
i want to get file mime type with following command line in a VPS
# file -bi <FILE_LOCATION>
but this command return empty for application/octet-stream mime type .
that command return correct answer in ubuntu but in centos not.
how can i fix it?
thanks
file -bi command line return empty
Re: file -bi command line return empty
Works fine here.
CentOS 5:
CentOS 6:
CentOS 5:
Code: Select all
$ dd if=/dev/urandom of=testmime bs=1024 count=1024
1024+0 records in
1024+0 records out
1048576 bytes (1.0 MB) copied, 0.166885 seconds, 6.3 MB/s
$ file -bi testmime
application/octet-stream
$ file -v
file-4.17
magic file from /usr/share/file/magic
Code: Select all
$ dd if=/dev/urandom of=testmime bs=1024 count=1024
1024+0 records in
1024+0 records out
1048576 bytes (1.0 MB) copied, 0.159065 s, 6.6 MB/s
$ file -bi testmime
application/octet-stream; charset=binary
$ file -v
file-5.04
magic file from /etc/magic:/usr/share/misc/magic
Re: file -bi command line return empty
Hello
thanks for your replay.
See this is my output on VPS :
Last command return empty!!!. That command return application/octet-stream on ubuntu!
I don't no why this command for some MP4 file that has this mime type return empty.
For other mp4 file that has another mime type this command work fine.!!
Probably there is a problem.
thanks for your replay.
See this is my output on VPS :
Code: Select all
[root@ser ~]# dd if=/dev/urandom of=testmime bs=1024 count=1024
1024+0 records in
1024+0 records out
1048576 bytes (1.0 MB) copied, 0.152582 seconds, 6.9 MB/s
[root@ser ~]# file -bi testmime
application/octet-stream
[root@ser ~]# file -bi /home/phoenix/Fa.mp4
[root@ser ~]#
I don't no why this command for some MP4 file that has this mime type return empty.
For other mp4 file that has another mime type this command work fine.!!
Probably there is a problem.
Re: file -bi command line return empty
"application/octet-stream" means the file is just binary data without any recognisable structure. If Ubuntu detects your mp4 files as application/octet-stream instead of the proper video/mp4 MIME type, it isn't really doing the job any better than CentOS. Without having access to your misdetected mp4 files, I can't say what's causing them to not get detected properly.