Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Upload a large file with delegate token fails #216

Open
giammin opened this issue Feb 26, 2024 · 1 comment
Open

[Bug]: Upload a large file with delegate token fails #216

giammin opened this issue Feb 26, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@giammin
Copy link

giammin commented Feb 26, 2024

Version

2.5.6

Environment that reproduces the issue

nodejs v20.11.1
typescript v5.3.3

Is it reproducible in the example application?

Yes

Reproduction steps

      const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY"});
      const token="TOKEN"
      const file="a file bigger than chunk size.mp4"
      await client.videos.uploadWithUploadToken(token, file);

Expected result

a working video object

Actual result

ES: if the file is divided in 4 chunks than 4 video object are created.

and none of them are working

this is the method resulting object:

{
  videoId: 'vi2AzYUF1JDmzt8XnuXUdHpJ',
  createdAt: undefined,
  title: undefined,
  description: undefined,
  publishedAt: undefined,
  updatedAt: undefined,
  tags: undefined,
  metadata: undefined,
  source: undefined,
  assets: undefined,
  playerId: undefined,
  _public: undefined,
  panoramic: undefined,
  mp4Support: undefined
}

Additional context

No response

Relevant logs output

No response

@giammin giammin added the bug Something isn't working label Feb 26, 2024
@giammin
Copy link
Author

giammin commented Feb 26, 2024

giving a quick look at sources and api documentation, I think the problem is here:

const chunkFormData = new FormData();

videoId is not sent in the body during the next chunks upload

https://docs.api.video/reference/api/Videos#upload-with-an-delegated-upload-token

@giammin giammin changed the title [Bug]: Upload with delegate token large file [Bug]: Upload a large file with delegate token fails Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant