--f46d04462fe0d5c10f04c4520294 Content-Type: text/plain; charset=UTF-8 On Sun, Jul 8, 2012 at 4:29 AM, David Faure wrote: > On Thursday 28 June 2012 06:13:15 Aish Raj Dahal wrote: > > The issue is that KIO attempts to download the entire file before > > being able to query for its HTTP header responses. This behavior may > > be taken lightly for smaller files, however for larger files > > downloading an entire file, just to get the HTTP header response > > associated with it seems to be impractical. > > As Albert said, the headers are sent as soon as they are received, and the > mimetype signal is emitted before the contents of the file, this is by > contract > for KIO::get(). This is how we can put the job on hold while launching the > proper application for that url, and the app then resumes the download in > order to get the file contents. > > > Alternatively you could use KIO::mimetype which performs an HTTP HEAD > request > on the given URL, but we had the experience (many years ago) that some > webservers didn't reply correctly to HEAD requests. > The other alternative (actually a hack) you have is to connect to the KIO's mimeType signal and put the ioslave on hold as outlined in KIO::get's documentation. That should allow you to retrieve the header before downloading the file. You can then resume the download by issuing a second get request. Dawit A. --f46d04462fe0d5c10f04c4520294 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Sun, Jul 8, 2012 at 4:29 AM, David Fa= ure <faure@kde.org> wrote:
On Thursday 28 June 2012 06:13:15 Aish Raj Dahal wrote: > The issue is that KIO attempts to download the entire file before
> being able to query for its HTTP header responses. This behavior may > be taken lightly for smaller files, however for larger files
> downloading an entire file, just to get the HTTP header response
> associated with it seems to be impractical.

As Albert said, the headers are sent as soon as they are received, an= d the
mimetype signal is emitted before the contents of the file, this is by cont= ract
for KIO::get(). This is how we can put the job on hold while launching the<= br> proper application for that url, and the app then resumes the download in order to get the file contents.


Alternatively you could use KIO::mimetype which performs an HTTP HEAD reque= st
on the given URL, but we had the experience (many years ago) that some
webservers didn't reply correctly to HEAD requests.

The other alternative (actually a hack) you have is to con= nect to the KIO's mimeType signal and put the ioslave on hold as outlin= ed in KIO::get's documentation. That should allow you to retrieve the h= eader before downloading the file. You can then resume the download by issu= ing a second get request.

Dawit A.
--f46d04462fe0d5c10f04c4520294--