[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fake PDF


Il 24/02/26 16:49, Lee ha scritto:
Well, I'm not Benoît, but I can tell you that it is not a mistake on your part and that the Mime type IS working.

The code of DesktopMime.FromFile() tries first to determine the MIME type by querying the MIME database file (/usr/share/mime/globs2) which lists the MIME type based on the file's extension. On my system, line 139 of that file indicates that "*.pdf" files are of type "application/ pdf".

It can be fooled if the extension is not correct. If you need better mime type determination, you can shell out to `file`.

Hi Lee,

I'm probably not understanding what you're trying to say. I tried using BaseName, but I get an error and don't get "File type: Plain Text Document (text/plain)" like I get when opening the same file with Mint's document viewer.

Regards
Gianluigi


Follow-Ups:
Re: Fake PDFgbWilly <gbWilly@xxxxxxxxxxxxxx>
Re: Fake PDFLee <t.lee.davidson@xxxxxxxxx>
References:
Fake PDFGianluigi <gradobag@xxxxxxxxxxx>
Re: Fake PDFLee <t.lee.davidson@xxxxxxxxx>