If HttpUtils.IsSuccess(FileUrl) Then
File.Copy2(HttpUtils.GetInputStream(FileUrl),File.OpenOutput(File.DirRootExternal,FileName,False))
ToastMessageShow("Done", False)
Else
ToastMessageShow("Error!", False)
End If
It throw no errors, download the file, size correct, but content of the file is incomplete or bad.
File. Copy2 (In As java.io.InputStream, Out As java.iutputStream)
Copies all the available data from the input stream into the output stream.
The input stream is automatically closed at the end.