0

I'm attempting to upload a video from a Java (Spring Boot) application to the Cloudflare servers by pulling the video using Spring's RestTemplate and then using the response InputStream to upload the content.

To upload the video content (InputStream), I'm following the docs at Upload Video File and API docs: Video Upload Using TUS

I've used the recommended official tus-java client; But, when I attempt to upload the video I'm getting a

unexpected status code (400) while uploading chunk

When I debug the tus-java-client, I see the underlying error being thrown by the Cloudflare endpoint is:

{
  "result": null,
  "success": false,
  "errors": [
    {
      "code": 10004,
      "message": "Decoding Error"
    }
  ],
  "messages": [
    {
      "code": 10004,
      "message": "invalid character '\\x00' looking for beginning of value"
    }
  ]
}

Is there any solution to this so I can successfully upload the video to Cloudflare (stream service)?

I'm using Java 17 and TUS java client version 0.4.5


The full source code of what I'm trying to do along with the steps to replicate this can be checked at this GitHub repo (but please, to let me know if I should paste it here): https://github.com/lealceldeiro/cloudflareuploader#run-the-app


There's an open question in the Cloudflare community here: https://community.cloudflare.com/t/10004-decoding-error-while-uploading-video-to-stream/471107/1

lealceldeiro
  • 14,342
  • 6
  • 49
  • 80

0 Answers0