Closed Arteneko closed 4 years ago
Can you provide stacktrace and steps to reproduce the issue?
[qtp1300801804-17] ERROR spark.http.matching.GeneralError -
com.uploadcare.exceptions.UploadcareInvalidRequestException: Request does not contain files.
at com.uploadcare.api.RequestHelper.checkResponseStatus(RequestHelper.java:249)
at com.uploadcare.api.RequestHelper.executeQuery(RequestHelper.java:124)
at com.uploadcare.upload.FileUploader.upload(FileUploader.java:95)
at org.artemix.laurasgallery.api.uploadcare.Uploadcare.upload(Uploadcare.java:26)
Use the following method, passing an InputStream.
In the trigger context, the InputStream was obtained from a SparkJava Request part object (see second snippet below).
public UUID upload(InputStream stream, String filename) throws UploadFailureException {
Uploader uploader = new FileUploader(client, stream, filename);
return UUID.fromString(uploader.upload().save().getFileId());
}
Part imageFile = req.raw().getPart("image");
I'm running into this exact issue. Any updates?
Hi @baileyatwork. We're planning to update Java client before mid-summer. All issues will be fixed and the latest API version will be supported!
@baileyatwork actually, we'll take a look into it in a few days!
👍 Thanks, @rsedykh.
@baileyatwork library has been updated to v3.3.0. This issue should be fixed.
The triggered exception is
com.uploadcare.exceptions.UploadcareInvalidRequestException: Request does not contain files
My guess is that the code is missing a file-field declaration.