[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: TransferJob should allow to examine media type by content
From: "=?utf-8?B?S8WZacWhdG9mIMW9ZWxlY2hvdnNraQ==?=" <yecril71pl () gmail ! com>
Date: 2012-03-15 22:09:22
Message-ID: 2005940.12eJRhiZHq () ne-1-26
[Download RAW message or body]
== Question ==
How do I examine a media type by content? I would like to disregard
information provided by the server.
== Motivation ==
Information provided by the server is often inaccurate (e.g video sent as
text/plain, or application/x-msdownload). Even the local file server which is
handled by FreeDesktop shared mime info gives wrong answers sometimes.
Examining media types by content requires downloading a small initial portion
of a resource, and downloading the whole thing to feed it to (KMimeType
::findbyContent) may be very wasteful. So the solution is to download an
initial fragment; however, only the media type database knows exactly how long
that initial fragment would be, and I do not know any way to determine the
required length up front.
== Suggestion ==
Let's add a flag to KIO ::TransferJob determine the media type by content.
That way, it could signal the media type as soon as it is able to determine it
(from partial content) and the rest of the job could be discarded if it turns
out that the client is not prepared or unwilling to handle this kind of data.
Best regards,
Chris
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic