CF Direct Creator Uploads TUS

Hi there,
I’m new to CF Stream and am working into our application for video uploads using tus-js.

I can obtain a tokenised URL for a standard direct upload using CURL to request to “…stream/direct_upload”

I’m attempting to obtain a tokenised URL for a TUS upload using CURL, but am not seeing any response headers at all on success (the pending upload video appears in my CF stream dashboard, however).

curl -H ‘Authorization: Bearer {API Key}’ -X POST -H ‘Tus-Resumable: 1.0.0’ -H ‘Upload-Length: 10000’ -H ‘Upload-Metadata: maxDurationSeconds MjE2MDA=,allowedOrigins {BASE64ORIGINS}’ ‘https://api.cloudflare.com/client/v4/accounts/{account ID}/stream?direct_user=true’

Could someone please help me to figure out what is probably a really daft mistake on my part?

Thank you in advance.

Hello,

The only person I know who’s quite familiar with this is @renan.

Hey @euphbasio the curl request you posted doesn’t return a body per TUS protocol (so your cURL command won’t show a response by default). If you add -v to the cURL command, you will get the response headers Stream returns.
Hope this helps!

2 Likes

This topic was automatically closed after 6 days. New replies are no longer allowed.