Android Question HOW TO CONTROL UPLOAD FILE USING HTTPUTILS

little3399

Active Member
Licensed User
Longtime User
HI,

If I upload files during using httputils2 lib an error occurred, such as network error ,socket timeout ...etc, How can I do to overcome these case ?


,
 

little3399

Active Member
Licensed User
Longtime User
Hi,DonManfred

I have some question about the HttpJob routine, for example during upload a large file , an error occurred ... and the file just upload a half ...,
and this case will be catch and HTTPJOB will return false ?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
In your description you wrote about network error ,socket timeout
Success will be false in JobDone then, yes. You can get the error with
B4X:
Job.ErrorMessage
in JobDone...

B4X:
Sub JobDone(Job As HttpJob)
    HideKeyboard
    ProgressDialogHide
    If Job.Success Then
        If Job.JobName = "AddToCart" Then
        Else
            ToastMessageShow(Job.JobName&": " & Job.GetString, True)
        End If
    Else
        ToastMessageShow("Error: " & Job.ErrorMessage, True)
    End If
    Job.Release
End Sub
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…