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

Re: Fake PDF


On 2/24/26 5:26 AM, Gianluigi wrote:
Hi Benoit,

Is this a mistake on my part, or is the MIME TYPE not working?

See the attached example.

Thanks, regards
Gianluigi

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`.


--
Lee

--- Gambas User List Netiquette [https://gambaswiki.org/wiki/doc/netiquette] ----
--- Gambas User List Archive [https://lists.gambas-basic.org/archive/user] ----


Follow-Ups:
Re: Fake PDFGianluigi <gradobag@xxxxxxxxxxx>
References:
Fake PDFGianluigi <gradobag@xxxxxxxxxxx>