"Dynamic" website content

Diez B. Roggisch deets at nospam.web.de
Sat Jan 21 13:28:35 EST 2006


sophie_newbie schrieb:
> Basically I have written a cgi script to automatically download TIFF
> images of patents from the US patent office.
> 
> What I want is that the user can see what is happening when the images
> are being downloaded, because it takes a while to download them and
> there can be anything up to 30 individual files for each image.
> 
> Is there a way of using Python or any other means, that I could it
> could print on the webpage:
> 
> Downloading image 1
> 
> Downloading image 2
> ...
> Downloading image X
> 
> as the individual pictures are being downloaded so the user doesn't
> think the program is hanging?

Why? In my browser, if I download a file, the browser itself shows a 
nice progress-bar. I guess what you are after is a way to trigger a 
download while the current page is displayed in the browser.

Looking at sf, one can see that the header of the site explaining to you 
that your download now starts contains this:

	<meta http-equiv="refresh" content="5; 
URL=http://peterhost.dl.sourceforge.net/sourceforge/winavr/WinAVR-20050214-install.exe" 
/>


That means that 5 seconds later, the URL is fetched. As the type is 
neither image nor HTML, the browser will download it.

In conclusion, it should even suffice to just let the user click that 
link itself. Then the browser should start downloading that image of yours.

Regards,

Diez



More information about the Python-list mailing list