cloudconvert / cloudconvert-java

Official CloudConvert Java SDK
37 stars 20 forks source link

Error during the upload of single file #24

Closed Pavansid94 closed 3 years ago

Pavansid94 commented 3 years ago

Hello,

I'm following the Upload method as suggested by the official SDK. But there seems to be an issue. Every time i try to upload a single file, i get the same error with message "POST requires exactly one file upload per request.". Details are attached. image image

Any help would be appreciated!

josiasmontag commented 3 years ago

Are you using the latest version 1.0.4? Also, do the integration tests of the SDK work on your system?

Pavansid94 commented 3 years ago

Yes, this is the latest version. The integration seems alright and i'm able to also do a UploadUsingURL sucessfully, but this particular use case seems to fail.

josiasmontag commented 3 years ago

I would suggest to run and debug uploadImportInputStreamAndExportUrlTaskLifecycle() and check what is different in your case. In specific, how does inputStream look like, is it readable etc.

Pavansid94 commented 3 years ago

Okay, alright, after inspection, i see no major differences in the InputStream of uploadImportInputStreamAndExportUrlTaskLifecycle() and mine (i can share you the screenshots for each of those contents in case you need). But i wonder why it is considering the request as containing Multiple files though?

Pavansid94 commented 3 years ago

Okay, a delayed update, a look atjobsIntegrationTest#mergeFileTaskAsJobLifecycle() at [Line 92] gave me the right way of using the upload. It's now working and i'll close this issue myself, but might want to update the README with regards to upload because that piece of code doesn't work.