Boring "URLDownloadToFile_" problem
Posted: Thu Jun 23, 2011 5:47 pm
Hi folks,
since several days I'm struggling with a problem downloading an webcam image from www.
Yes, I know. Sounds very simple. But please let me explain.
First I used the PB internal procedure "ReceiveHTTPFile()" but it fails. Than I started with " URLDownloadToFile_".
I works partly. I would like to update the webcam image every 5 minutes. The downloaded file is
stored in windows temp folder and then a ImageGadget is updated.
The problem now is, that it looks like, that "DeleteUrlCacheEntry_" does not clear the cache. On first start of
the procedure everthing works fine, after 5 minutes update the image is not updated. What for me is
strange, on every new start of the code the image is updated (close in compiler/exe and restart)
I also tried to delete the temp file before the download starts, but nothing helps
The webcam image on site is password protected and I handed over it in the url$ by "xxx:yyy@"
Is there any chance to empty the cache or is there another solution? At the moment I run out of ideas. I already had coded this years ago with "MMB - Multimedia Builder" and it works perfect. This software is now outdated that's why I try to port this to PB.
I will not handover the user the passwords for the webcam, so I think a WebGadget is also not a solution.
In principle is very simple the software should download the image and show it in a window. I use Win 7 and XP in 32 and 64bit. Same problem on both systems.
Hopefully one of the forums pb-experts can help me to get this fixed.
since several days I'm struggling with a problem downloading an webcam image from www.
Yes, I know. Sounds very simple. But please let me explain.
First I used the PB internal procedure "ReceiveHTTPFile()" but it fails. Than I started with " URLDownloadToFile_".
I works partly. I would like to update the webcam image every 5 minutes. The downloaded file is
stored in windows temp folder and then a ImageGadget is updated.
The problem now is, that it looks like, that "DeleteUrlCacheEntry_" does not clear the cache. On first start of
the procedure everthing works fine, after 5 minutes update the image is not updated. What for me is
strange, on every new start of the code the image is updated (close in compiler/exe and restart)
I also tried to delete the temp file before the download starts, but nothing helps

The webcam image on site is password protected and I handed over it in the url$ by "xxx:yyy@"
Is there any chance to empty the cache or is there another solution? At the moment I run out of ideas. I already had coded this years ago with "MMB - Multimedia Builder" and it works perfect. This software is now outdated that's why I try to port this to PB.
I will not handover the user the passwords for the webcam, so I think a WebGadget is also not a solution.
In principle is very simple the software should download the image and show it in a window. I use Win 7 and XP in 32 and 64bit. Same problem on both systems.
Hopefully one of the forums pb-experts can help me to get this fixed.
Code: Select all
cam$=Temp$+"cam_temp.jpg"
url$="http\\xxx:yyy@www.test-url.com
Procedure Loadpicture(url$,cam$)
DeleteUrlCacheEntry_(url$)
URLDownloadToFile_(0,url$,cam$,0,0)
LoadImage(#Background, )
If IsGadget(#background)
SetGadgetState(#background,ImageID(#background))
EndIf
EndProcedure