Android Question [SOLVED] Problem with downloading big file

parijs

Active Member
Licensed User
Longtime User
I have to download a big file for my app (193MB)
With ftp it takes too long and my log says ' Ignoring event (too many queued events: ftp_downloadprogress).

Download by website is faster and works for me, but not for customers.
They get this error
sub: httpjob_getinputstream (java line: 143)
java.oi.FileNotFoundException: /data/user/0/com.hr.ketels/cache/2 (no such file or directory)

The code that I use is

 

AnandGupta

Expert
Licensed User
Longtime User
Download by website is faster and works for me, but not for customers.
They get this error
sub: httpjob_getinputstream (java line: 143)
java.oi.FileNotFoundException: /data/user/0/com.hr.ketels/cache/2 (no such file or directory)

The "FileNotFoundException" may mean that the file right permission is missing for the customers.

Regards,

Anand
 
Upvote 0

parijs

Active Member
Licensed User
Longtime User
Hi Anand,

They have right permission.

B4X:
    rp.CheckAndRequest(rp.PERMISSION_CALL_PHONE)
    Wait For Activity_PermissionResult (Permission As String, result As Boolean)
    
    rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
    Wait For Activity_PermissionResult (Permission As String, result As Boolean)
    
    If result Then
        File.MakeDir(File.DirRootExternal,"HrKetels")
        File.Copy(File.DirAssets,"storing.db", File.DirRootExternal, "HrKetels/storing.db")
        If File.Exists(File.DirRootExternal, "HrKetels/vitidens111.zip") = False Then
            StartActivity(dl)
        End If

        If File.Exists(File.DirRootExternal, "HrKetels/favo.db") = False Then
            File.Copy(File.DirAssets,"favo.db", File.DirRootExternal, "HrKetels/favo.db")
        End If
        If File.Exists(File.DirRootExternal, "HrKetels/bedrijf.db") = False Then
            File.Copy(File.DirAssets,"bedrijf.db", File.DirRootExternal, "HrKetels/bedrijf.db")
        End If
        
    End If

The DB files are in the directory

Regards,
Zeger
 
Upvote 0

AnandGupta

Expert
Licensed User
Longtime User
I mean, "/data/user/0/com.hr.ketels/cache/2 (no such file or directory)" means access right restriction on web file

Regards,

Anand
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…