I'm trying to download a zipfile and unzip it on a iOS device. The zipfile contains 50± images, I want to load them into background images. The download part works (I think), and the unzipping part also (I think ). But the strange thing is, it doesn't show an image.
Here is my code:
Code on card 1, download the zip + unzip it
Code: Select all
on downloadFiles
libUrlDownloadToFile "URL to zipfile", specialfolderpath ("Documents") & "/imagesApp.zip", "unZip"
end downloadFiles
command unZip
put specialFolderPath("documents") & "/imagesApp.zip" into TempFile
put specialFolderPath("documents") & "/images/" into TargetFile
revZipOpenArchive TempFile, "read"
put RevZipEnumerateItems(TempFile) into tList
repeat for each line i in tList
if i = empty then
next repeat
end if
revZipExtractItemToFile TempFile, i, TargetFile & "/" & i
end repeat
revZipCloseArchive TempFile
delete file TempFile
end unZip
Code: Select all
on preOpenCard
if the environment is not "mobile" then
exit preOpenCard
end if
set the filename of image "ImageHolder" to specialFolderPath("documents") & "/images/1.jpg"
end preOpenCard
Kind regards,
Chris