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 ?


,
 

DonManfred

Expert
Licensed User
Longtime User
You get an Job.Success = false in such case... You need to react on this, then...
 
Upvote 0

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
Top