Currently I am downloading a file with https using Erel's post #2 at https://www.b4x.com/android/forum/threads/solved-download-files-from-server-with-progress.126797/.
First question:
where does the download go, in terms of the device's file structure?
I noticed some coding on copying a file to File.DirInternal/"filename.dat" at https://www.b4x.com/android/forum/threads/b4x-okhttputils2-with-wait-for.79345/#content:
Second question:
If I wanted to write the downloaded file to the standard Downloads directory so that it would be accessible by me using the device's File Manager, what would I write instead of File.DirInternal, "filename.dat") in the line starting with "Dim out"?
First question:
where does the download go, in terms of the device's file structure?
I noticed some coding on copying a file to File.DirInternal/"filename.dat" at https://www.b4x.com/android/forum/threads/b4x-okhttputils2-with-wait-for.79345/#content:
B4X:
Sub DownloadAndSaveFile (Link As String)
Dim j As HttpJob
j.Initialize("", Me)
j.Download(Link)
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Dim out As OutputStream = File.OpenOutput(File.DirInternal, "filename.dat", False)
File.Copy2(j.GetInputStream, out)
out.Close '<------ very important
End If
j.Release
End Sub
Second question:
If I wanted to write the downloaded file to the standard Downloads directory so that it would be accessible by me using the device's File Manager, what would I write instead of File.DirInternal, "filename.dat") in the line starting with "Dim out"?