Hi,

I'm searching for some howto or example on how to handle downloads
with QtWebkit correctly, especially the unsupportedContent signal.

My main problem is what to do with the open QNetworkReply while asking
the user for a filename to save the file to. I've looked into some
existing projects using QtWebKit and I've seen these approaches so
far:

- Just downloading to RAM (i.e. the default Qt behaviour, ignoring
  readRead with no buffer size set) -> RAM could fill up rather fast.
  I have a 250 MBit connection here, so potentially a gigabyte of RAM
  is filled if I take 30 seconds to enter a filename.

- Not downloading anything until the filename is entered -> server
  will probably close the connection after some seconds.

- Just re-doing the request using the URL from the reply -> Could lead
  to a lot of problems, e.g. with DRM-like "you may download this file
  N times" sites.

- Downloading to a temporary file until the user has entered the
  filename, then copying it over and deleting the temporary file.

The last approach seems to be the cleanest to me, and this seems to be
what Firefox/Chrome do as well. I've seen the Otter browser[1] doing
this, but not anything else yet.

Am I on the right track? Is there some documentation about how to do
this the right way anywhere?

Thanks!

Florian

[1] http://otter-browser.org/

-- 
http://www.the-compiler.org | m...@the-compiler.org (Mail/XMPP)
             GPG 0xFD55A072 | http://the-compiler.org/pubkey.asc
         I love long mails! | http://email.is-not-s.ms/

Attachment: pgpYlcDriAFIO.pgp
Description: PGP signature

_______________________________________________
webkit-qt mailing list
webkit-qt@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-qt

Reply via email to