Am having problem with OutofMemory crash when downloading image files with httputils. The download goes fine, but when it gets to File.Copy2 line, if the file is around 2MB, program stops, and log shows outofmemory:
Am wondering if I can get file attributes of the files on the server, so I can only download smaller files, then I'll deal with the larger ones separately. BTW, I can download larger files individually with no problem.
B4X:
Dim out As OutputStream
out = File.OpenOutput(File.DirDefaultExternal,file_name,False)
File.Copy2(HttpUtils.GetInputStream(link), out)
out.Close
Am wondering if I can get file attributes of the files on the server, so I can only download smaller files, then I'll deal with the larger ones separately. BTW, I can download larger files individually with no problem.