ItemId is null uploading file with the Java SDK

  • 1
  • Problem
  • Updated 11 months ago
  • (Edited)
I am trying to upload files using the Java SDK as described in the README, which works fine when the file is read from disk and inputStream.available() returns the actual fileSize. However, when I try to read an inputStream not from disk but from a remote client then inputStream.available() is 1, and requestParams.setFileSize is set to 1.

Debugging shows that SFUploadRunnable.upload() successfully reads from the inputStream into bytechunks that are sent to uploadChunk receiving statusCode 200 with responseString = {"error": false, "value": "OK"}, but when UploadProgressListener.onComplete is called then itemId=null and bytesTransfered=<correct fileSize, even though requestParams.setFileSize was initially set to 1>. Unfortunately, no file is to be seen in the ShareFile folder.

What happens here? I have tried setting variuos requestParamets, such as raw=true and method=Streamed, but to no luck. Any guidance would be gladly appreciated.
Photo of Øystein Molnes

Øystein Molnes

  • 19 Posts
  • 0 Reply Likes

Posted 11 months ago

  • 1

Be the first to post a reply!