sanduro Member Licensed User Longtime User Feb 14, 2014 #1 Hi, I am downloading the file from internet but i don't want to save it to file, instead i I want to store it in Byte array , cos i will send it via serial when completed. Is if possible to do it , without intermediate save to file ? Code: Copy Sub btnDownload_Click Dim dd As DownloadData dd.url = link1 dd.EventName = "dd" dd.Target = Me CallSubDelayed2(DownloadService, "StartDownload", dd) End Sub
Hi, I am downloading the file from internet but i don't want to save it to file, instead i I want to store it in Byte array , cos i will send it via serial when completed. Is if possible to do it , without intermediate save to file ? Code: Copy Sub btnDownload_Click Dim dd As DownloadData dd.url = link1 dd.EventName = "dd" dd.Target = Me CallSubDelayed2(DownloadService, "StartDownload", dd) End Sub
Erel B4X founder Staff member Licensed User Longtime User Feb 14, 2014 #2 Where is this code taken from? You should use HttpUtils2 to download the file. You can then do whatever you like with it. Upvote 0
Where is this code taken from? You should use HttpUtils2 to download the file. You can then do whatever you like with it.
sanduro Member Licensed User Longtime User Feb 14, 2014 #3 It is from your example http://www.b4x.com/android/forum/threads/download-huge-files-with-httputils2.30220/#content I just don't get the Tartget method it has a parameter type OBJECT , and I am lost, I don't understand what is the result of completed job and where are the data that was downloaded? Last edited: Feb 14, 2014 Upvote 0
It is from your example http://www.b4x.com/android/forum/threads/download-huge-files-with-httputils2.30220/#content I just don't get the Tartget method it has a parameter type OBJECT , and I am lost, I don't understand what is the result of completed job and where are the data that was downloaded?
Erel B4X founder Staff member Licensed User Longtime User Feb 14, 2014 #4 You should handle the JobDone event. Target = Me is correct. In the JobDone sub you can read the downloaded file to a bytes array. Upvote 0
You should handle the JobDone event. Target = Me is correct. In the JobDone sub you can read the downloaded file to a bytes array.
sanduro Member Licensed User Longtime User Feb 14, 2014 #5 OK , I see httputils2, if i call Job.GetString method it returns the string, but i need array of bytes to be returned. So i should call Job.GetInputStream method. Got it it works now Thanks Erel Last edited: Feb 14, 2014 Upvote 0
OK , I see httputils2, if i call Job.GetString method it returns the string, but i need array of bytes to be returned. So i should call Job.GetInputStream method. Got it it works now Thanks Erel