I use the following code to download an image:
and, then, I use the following code to get the image:
However, every once in a while, for a variety of other reasons, the file to be downloaded is missing or has been deleted by some other process. This causes the above Job.GetBitmap to throw an error which I handle and put a "image missing" image into variable bmp.
I'd like to avoid the error entirely - is there a way to test if the Job really has a file or not? I've tried:
But this doesn't work. Is there another way?
B4X:
Dim j As HttpJob
j.Initialize("ImgDownload", Me)
j.Download(ServerUrl & "media/" & $Filename)
B4X:
Dim bmp As Bitmap = Job.GetBitmap
I'd like to avoid the error entirely - is there a way to test if the Job really has a file or not? I've tried:
B4X:
If Job.GetBitmap = Null Then ...