httputils2 (preferably) to upload images

Malky

Active Member
Licensed User
Longtime User
Hi, I have been going through most possibilities here and need to download small image files from my php server. I think I am confusing myself now as I have tried too many possible methods/examples with no success.

For my app, I want to replicate my small SQL Lite database on the external(?) card and download the actual files onto the phone. (Image filenames stored in the DB).

Preferably I would like to download them all or sections of them in a list after inserting each table with image names.

When I have tried this I get the last file downloaded to the phone valid, but the previous ones are invalid. Is there an example of downloading a single image, or list of images to the external card?

Most just display the image in an imageview after download, but not copying to external and the flickr one means ripping a page apart which I don't need.

Thanks in advance,

Malky
 
Last edited:

Malky

Active Member
Licensed User
Longtime User
I'm back I'm afraid!

I've decided I need to now populate all tables at once, which also means downloading the images for each.

Your previous solution solves this for one table, but as the image files will still be downloading after the calls, how do I stall things before even starting the main app?

Bearing in mind I do not want to download the images if they already exist on the external/internal card. This results in the jobs done function being bypassed. As shown below....
B4X:
If ((File.Exists(SD_PATH,imagename) AND OverWriteImages = True)) OR (Not (File.Exists(SD_PATH,imagename))) Then
            Dim Job As HttpJob
            Job.Initialize(imagename, Me)
            Job.Download(URL & "images/prop_apps/thumbs/langs/" & imagename)
            JobArray(i) = Job

I only use the OverWriteImages as a boolean variable for testing to simulate the app having already been installed or not.

Cheers,

Malky
 
Last edited:
Upvote 0

Malky

Active Member
Licensed User
Longtime User
UPDATE!!!

I think it could be better to just query the complete list of the required images for the whole app and then add them to the list of jobs rather than do it for each required table?
This way I just need to check on the one main job list completing, then continue with the activity.

Malky
 
Upvote 0
Top