You are not logged in.

#1 2011-09-11 00:14:23

robcat
Member
From: Fermo
Registered: 2009-02-21
Posts: 19

How GNOME identifies the file type?

I downloaded from my bank website a PDF document using chromium.
The file is saved as "document.php" but the file utility report correctly:

document.php: PDF document, version 1.5

The GNOME properties dialog shows instead:

Type: PHP script (application/x-php)

It is annoying because when I open the file via nautilus, gedit is launched (default for php files). If I change the file name to "document.pdf" evince is correctly launched.

So, what method does GNOME use to check the file type? Is it configurable?
If the "file" utility is smarter, can I tell nautilus to use that?

Offline

#2 2011-09-11 07:14:42

satanselbow
Member
Registered: 2011-06-15
Posts: 538

Re: How GNOME identifies the file type?

This is not an uncommon problem - and is down to poor server config / code at the the bank website end not Gnome. The filename "download.php" is most likely the name of the actual script that instigated the file transfer and has been lazily coded not to rename the actual file transfer as a "pdf". I can only assume your bank got a college student in to do a cheap script for them big_smile

The file you have been sent has a "php" extension - so Gnome does what it is told, opening it with gedit. Even though the content is PDF.

Offline

Board footer

Powered by FluxBB