Carthalion Member Licensed User Longtime User Dec 10, 2016 #1 Downloading files works, but not all files every time. There are 24 downloads. Sometimes it downloads all the files but sometimes only half. Is there a way to make this more consistent? Only downloading six and a time? Another idea...is there a way to pre-install these files in DirRootExternal as part of the .apk file? Also, I tried to use the code editor. Sorry about that. Next time, I hope. Sub GetFiles Dim job1 As HttpJob job1.Initialize("job1", Me) job1.Download("http://www.mysite.com/" & FolderName & "/textfiles/InetLolo.txt") Dim job2 As HttpJob job2.Initialize("job2", Me) job2.Download("http://www.mysite.com/" & FolderName & "/textfiles/InetLo.txt") End Sub Select job.jobName Case "job1" Dim out As OutputStream = File.OpenOutput(File.DirRootExternal, "QQFiles/InetLolo.txt", False) File.Copy2(job.GetInputStream, out) out.Close Case "job2" Dim out As OutputStream = File.OpenOutput(File.DirRootExternal, "QQFiles/InetLo.txt", False) File.Copy2(job.GetInputStream, out) out.Close End Select Last edited: Dec 10, 2016
Downloading files works, but not all files every time. There are 24 downloads. Sometimes it downloads all the files but sometimes only half. Is there a way to make this more consistent? Only downloading six and a time? Another idea...is there a way to pre-install these files in DirRootExternal as part of the .apk file? Also, I tried to use the code editor. Sorry about that. Next time, I hope. Sub GetFiles Dim job1 As HttpJob job1.Initialize("job1", Me) job1.Download("http://www.mysite.com/" & FolderName & "/textfiles/InetLolo.txt") Dim job2 As HttpJob job2.Initialize("job2", Me) job2.Download("http://www.mysite.com/" & FolderName & "/textfiles/InetLo.txt") End Sub Select job.jobName Case "job1" Dim out As OutputStream = File.OpenOutput(File.DirRootExternal, "QQFiles/InetLolo.txt", False) File.Copy2(job.GetInputStream, out) out.Close Case "job2" Dim out As OutputStream = File.OpenOutput(File.DirRootExternal, "QQFiles/InetLo.txt", False) File.Copy2(job.GetInputStream, out) out.Close End Select
MarcoRome Expert Licensed User Longtime User Dec 10, 2016 #2 Please use option where you insert code: Upvote 0
DonManfred Expert Licensed User Longtime User Dec 10, 2016 #3 Carthalion said: Another idea...is there a way to pre-install these files in DirRootExternal as part of the .apk file? Click to expand... You can place them in your FILES folder and on appstart copy them to the folder you want (if not already exists) Upvote 0
Carthalion said: Another idea...is there a way to pre-install these files in DirRootExternal as part of the .apk file? Click to expand... You can place them in your FILES folder and on appstart copy them to the folder you want (if not already exists)
MarcoRome Expert Licensed User Longtime User Dec 10, 2016 #4 Look THIS Thread. Your error is here: Code: Copy File.OpenOutput(File.DirRootExternal, "QQFiles/InetLimits.txt", False) so i think ( you must try ) Code: Copy File.OpenOutput(File.DirRootExternal & "/QQFiles/", "InetLimits.txt", False) Upvote 0
Look THIS Thread. Your error is here: Code: Copy File.OpenOutput(File.DirRootExternal, "QQFiles/InetLimits.txt", False) so i think ( you must try ) Code: Copy File.OpenOutput(File.DirRootExternal & "/QQFiles/", "InetLimits.txt", False)
MarcoRome Expert Licensed User Longtime User Dec 10, 2016 #5 Anyway for future when you insert new Thread, pls, write more information type: what you see in LOG WINDOWS, etc. Upvote 0
Anyway for future when you insert new Thread, pls, write more information type: what you see in LOG WINDOWS, etc.
Carthalion Member Licensed User Longtime User Dec 10, 2016 #6 MarcoRome said: Look THIS Thread. Your error is here: Code: Copy File.OpenOutput(File.DirRootExternal, "QQFiles/InetLimits.txt", False) View attachment 50852 so i think ( you must try ) Code: Copy File.OpenOutput(File.DirRootExternal & "/QQFiles/", "InetLimits.txt", False) Click to expand... I did try this and it has too many parameters. I appreciate your response however. Additionally, I found something that might help explain. When I step through the code, all 24 files are read and then written. Any idea why this would matter? Or any ideas about how to pursue this as a solution? Upvote 0
MarcoRome said: Look THIS Thread. Your error is here: Code: Copy File.OpenOutput(File.DirRootExternal, "QQFiles/InetLimits.txt", False) View attachment 50852 so i think ( you must try ) Code: Copy File.OpenOutput(File.DirRootExternal & "/QQFiles/", "InetLimits.txt", False) Click to expand... I did try this and it has too many parameters. I appreciate your response however. Additionally, I found something that might help explain. When I step through the code, all 24 files are read and then written. Any idea why this would matter? Or any ideas about how to pursue this as a solution?
Carthalion Member Licensed User Longtime User Dec 11, 2016 #7 Now I see where to enter the code. I was trying using the BB Code Editor. Thank you for showing me. (Above) Upvote 0
Now I see where to enter the code. I was trying using the BB Code Editor. Thank you for showing me. (Above)
Carthalion Member Licensed User Longtime User Dec 11, 2016 #8 DonManfred said: You can place them in your FILES folder and on appstart copy them to the folder you want (if not already exists) Click to expand... This does solve my dilemma. I do not know why, but if the files are already there, then they will read and rewrite again every time. Upvote 0
DonManfred said: You can place them in your FILES folder and on appstart copy them to the folder you want (if not already exists) Click to expand... This does solve my dilemma. I do not know why, but if the files are already there, then they will read and rewrite again every time.