tufanv Expert Licensed User Longtime User Feb 22, 2017 #1 Hello Is it possible to get the size of a httpjob after .download . I want to know the internet consumption of the job ( for ex: 22 kb ) Thanks
Hello Is it possible to get the size of a httpjob after .download . I want to know the internet consumption of the job ( for ex: 22 kb ) Thanks
Erel B4X founder Staff member Licensed User Longtime User Feb 22, 2017 #2 Check this example: https://www.b4x.com/android/forum/threads/download-huge-files-with-httputils2.30220/ Upvote 0
Check this example: https://www.b4x.com/android/forum/threads/download-huge-files-with-httputils2.30220/
Erel B4X founder Staff member Licensed User Longtime User Feb 22, 2017 #3 Another option is to add this sub to HttpJob class: B4X: Public Sub GetSize As Long Return File.Size(HttpUtils2Service.TempFolder, taskId) End Sub Upvote 0
Another option is to add this sub to HttpJob class: B4X: Public Sub GetSize As Long Return File.Size(HttpUtils2Service.TempFolder, taskId) End Sub
tufanv Expert Licensed User Longtime User Feb 22, 2017 #4 Erel said: Check this example: https://www.b4x.com/android/forum/threads/download-huge-files-with-httputils2.30220/ Click to expand... I am going to use it in b4j but i didnt think it will make a difference so i opened the topic here =) this is a b4a module, can it be used with b4j ? Upvote 0
Erel said: Check this example: https://www.b4x.com/android/forum/threads/download-huge-files-with-httputils2.30220/ Click to expand... I am going to use it in b4j but i didnt think it will make a difference so i opened the topic here =) this is a b4a module, can it be used with b4j ?
Erel B4X founder Staff member Licensed User Longtime User Feb 22, 2017 #5 If you only need the size then it will be simpler to add the sub from post #3. Upvote 0
tufanv Expert Licensed User Longtime User Feb 22, 2017 #6 Erel said: If you only need the size then it will be simpler to add the sub from post #3. Click to expand... is the result is bytes ? i get 4312 from job.size. this means : 4.312 kb ? Upvote 0
Erel said: If you only need the size then it will be simpler to add the sub from post #3. Click to expand... is the result is bytes ? i get 4312 from job.size. this means : 4.312 kb ?
Erel B4X founder Staff member Licensed User Longtime User Feb 22, 2017 #7 tufanv said: is the result is bytes ? Click to expand... Yes. tufanv said: i get 4312 from job.size. this means : 4.312 kb ? Click to expand... More or less. B4X: Log($"Size = $1.1${Job.GetSize / 1024} KB"$) Upvote 0
tufanv said: is the result is bytes ? Click to expand... Yes. tufanv said: i get 4312 from job.size. this means : 4.312 kb ? Click to expand... More or less. B4X: Log($"Size = $1.1${Job.GetSize / 1024} KB"$)
tufanv Expert Licensed User Longtime User Feb 22, 2017 #8 Thanks very much. Very short and useful solution. Upvote 0