animalplamet
Member
Hello, I'm new to the b4A tool but I'm gaining experience quickly
I have a problem with an HTTPJob postMultipart
I can correctly build the entire request, but the server responds to me
ResponseError. Reason: , Response: {"message":"file.not_found","error":"There is no file in request.","status":400,"cause":[]}
Any other POST or GET requests you make to the same server complete successfully.
The server does not seem to see the request files It is clear of course that the files exist in the indicated path and have access by the application (since they are photos that the application itself took)
I also tried with other files and other folders, and the message is the same
Any suggestion? Thank you very much
I have a problem with an HTTPJob postMultipart
I can correctly build the entire request, but the server responds to me
ResponseError. Reason: , Response: {"message":"file.not_found","error":"There is no file in request.","status":400,"cause":[]}
B4X:
If isCustomPic = True Then 'Publica con las fotos que tomó
If File.Exists(imgFolder, $"${thisPubPictures(1)}.jpg"$) = True Then
For imgs = 1 To 1 'cnt
prgML.Progress = 80 + imgs
Log($"prgML.Progress = "${80 + imgs}"$)
Dim JobImg As HttpJob
Dim itmFile As MultipartFileData
itmFile.Initialize
itmFile.Dir = imgFolder ' General.AppFolder
itmFile.FileName = $"${thisPubPictures(imgs)}.jpg"$ '"Discogs.json" '
itmFile.KeyName = thisPubPictures(imgs)
itmFile.ContentType = "image/jpeg" ' "application/json"
JobImg.Initialize("", Me)
JobImg.PostMultipart("https://api.mercadolibre.com/pictures/items/upload", Null, Array(itmFile))
JobImg.GetRequest.SetHeader("Authorization", $"Bearer ${access_token}"$)
Wait For (JobImg) jobDone (Jres As HttpJob)
If Jres.Success = False Then
Log(Jres.ErrorMessage)
prgML.Progress = 100
Else
Log(Jres.GetString)
End If
Next
End If
End If
Any other POST or GET requests you make to the same server complete successfully.
The server does not seem to see the request files It is clear of course that the files exist in the indicated path and have access by the application (since they are photos that the application itself took)
I also tried with other files and other folders, and the message is the same
Any suggestion? Thank you very much