W3C home > Mailing lists > Public > www-lib@w3.org > July to September 2006

libwww and avoiding download of binary/unknown files

From: Silvan Calarco <silvan.calarco@mambasoft.it>
Date: Mon, 4 Sep 2006 12:55:14 +0200
To: www-lib@w3.org
Message-Id: <200609041255.14712.silvan.calarco@mambasoft.it>

I'm writing my first app based on libwww, it aims to do something similar to 
webbot but I'm facing a problem that I can't solve because of my limited 
knowledge of the libwww architecture. 
When a web site is scanned recursively using anchors and requests all the 
files are downloaded including binary files. For these save file name is 
prompted to the user (my app and webbot behave in the same manner), but I 
don't want binary files to be downloaded at all. If I define the following 
callback user is not prompted anymore but file is transferred from network to 
the black hole thus generating unuseful traffic:


So my question is, can I detect the content type of a file (presumably letting 
libwww read just a part of it) and then decide not to download it?How?



mambaSoft di Silvan Calarco - http://www.mambasoft.it
Received on Monday, 4 September 2006 14:16:45 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:33:56 UTC