Android Upload / Download zip files issues
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Android Upload / Download zip files issues
I have been using a script by "jmburnod" "http://forums.runrev.com/phpBB2/viewtop ... =8&t=13466" to test out downloading and extracting zip files.
However I have only been able to get it working on desktop not Android.
However checking the code I do not see why it does not work on Android as all the code (as far as I can see) is compatible. So as I searched and came up with this post by "kray" http://livecodejournal.com/forum/viewto ... ?f=24&t=92
Is this still the case with the latest build of LC with Android Apps? This libURLDownloadToFile is unreliable?
Just to add, I am using the latest build of LC, Have added internet, revZip, and write to external storage to the standalone and use Android 4.3 on the Android Emulator.
I have tried small files and large files the download function just does not activate.
Thanks in advanced guys
However I have only been able to get it working on desktop not Android.
However checking the code I do not see why it does not work on Android as all the code (as far as I can see) is compatible. So as I searched and came up with this post by "kray" http://livecodejournal.com/forum/viewto ... ?f=24&t=92
Is this still the case with the latest build of LC with Android Apps? This libURLDownloadToFile is unreliable?
Just to add, I am using the latest build of LC, Have added internet, revZip, and write to external storage to the standalone and use Android 4.3 on the Android Emulator.
I have tried small files and large files the download function just does not activate.
Thanks in advanced guys
Re: Android Upload / Download zip files issues
Hi istech,
I don't know why that libURLDownloadToFile entry still says it's good for mobile. I don't think it ever worked on mobile?
Go with Ken Ray's "load" or use "put url".
Nice that load has that pData, makes it easy.
Simon
I don't know why that libURLDownloadToFile entry still says it's good for mobile. I don't think it ever worked on mobile?
Go with Ken Ray's "load" or use "put url".
Nice that load has that pData, makes it easy.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Android Upload / Download zip files issues
Hi Simon
LibUrldownloadToFile works on mobile. I tested it on IOS without mistake.
LibUrldownloadToFile works on mobile. I tested it on IOS without mistake.
https://alternatic.ch
Re: Android Upload / Download zip files issues
Thanks for the reply
This issue apparently only happens on Android devices. If you have one give it a try and let us know.
Presently I am trying to get a working script with load url. Any pointers would be great in any case.
At the moment it is in "needs more work" 
This issue apparently only happens on Android devices. If you have one give it a try and let us know.
Presently I am trying to get a working script with load url. Any pointers would be great in any case.
Code: Select all
on mouseUp
load url "http://www.alternatic.ch/jmb/devrev/images50.zip"
hide scrollbar "ProgressBar"
end mouseUp
on urlProgress pUrl, pStatus,pData
if the number of items in pStatus = 3 then ##will not work unless web server sends total
if the visible of scrollbar "ProgressBar" = false then
put the last item of pStatus into tTotalBytes
set the startValue of scrollbar "ProgressBar" to 0
set the endValue of scrollbar "ProgressBar" to tTotalBytes
show scrollbar "ProgressBar"
end if
set the thumbPosition of scrollbar "ProgressBar" to item 2 of pStatus
end if
if pStatus is "downloaded" then
answer "Finished downloading" with "Okay"
put pData into URL ("binfile:" & specialfolderpath("engine") & "/images50.zip")
hide scrollbar "ProgressBar"
unload url "http://www.alternatic.ch/jmb/devrev/images50.zip"
send "unZip" to me in 2 seconds
end if
end urlProgress
command unZip
put specialFolderPath("engine") & "/images50.zip" into TempFile
put specialFolderPath("engine") & "/" into TargetFile -- Problem part, previous one was linked to a map in a map, because the zip is a map.
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
send "fileCheck" to me in 1 second
end unZip
command fileCheck
if there is a file (specialfolderpath("engine") & "/pres.png") then
answer "it works!! Great!"
else
answer "needs more work"
end if
end fileCheck

Re: Android Upload / Download zip files issues
Hi,
Are you sure we can download a file to the engine folder ?
I never did it
Are you sure we can download a file to the engine folder ?
I never did it
https://alternatic.ch
Re: Android Upload / Download zip files issues
No, we CAN'T! 
@istech:
specialfolderpath("engine") is TABOO for writing!
Use specialfolderpath("cache") or specialfolderpath("documents") to store the loaded zip file!

@istech:
specialfolderpath("engine") is TABOO for writing!

Use specialfolderpath("cache") or specialfolderpath("documents") to store the loaded zip file!
Re: Android Upload / Download zip files issues
Hi,
put pData into URL ("binfile:" & specialfolderpath("engine") & "/images50.zip")
That's not good, you can't write to the engine folder.
put pData into URL ("binfile:" & specialfolderpath("documents") & "/images50.zip")
is where you want to put the file.
Simon
put pData into URL ("binfile:" & specialfolderpath("engine") & "/images50.zip")
That's not good, you can't write to the engine folder.
put pData into URL ("binfile:" & specialfolderpath("documents") & "/images50.zip")
is where you want to put the file.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Android Upload / Download zip files issues
Ah thanks I will give it a shot.
Klaus you know I like doing things with the specialfolderpath you shouldn't or can't
Can we copy to the engine location after we download? Or is it strictly no go. (gone to have a look at the docs again)
Klaus you know I like doing things with the specialfolderpath you shouldn't or can't

Can we copy to the engine location after we download? Or is it strictly no go. (gone to have a look at the docs again)
Re: Android Upload / Download zip files issues
Hi istech,
As Klaus said
No.Can we copy to the engine location after we download?
As Klaus said
specialfolderpath("engine") is TABOO for writing!
https://alternatic.ch
Re: Android Upload / Download zip files issues
No, I don't know, but it is up to you to let your device EXPLODE!istech wrote:Klaus you know I like doing things with the specialfolderpath you shouldn't or can't
