[SOLVED] it issue from my load-balacing nginx server config
My link: https://api.vzfile.vn/video/3355/get
It available to stream on browser but can not upload to CF via link
I was try to use ngrox to try it success upload!
Please show me some sugestions to fix this issue!
Thx!
1 Like
Same thing, followed the curl command given under the “Use API” tab
Here’s the error response:
{
“result”: null,
“success”: false,
“errors”: [
{
“code”: 10010,
“message”: “Invalid URL”
}
],
“messages”: [
{
“code”: 10010,
“message”: “Performed a HTTP HEAD request, but HEAD request did not include a content-length header. Please make sure your origin returns content length headers.”
}
]
}
zaid
July 9, 2021, 5:29pm
3
We’re investigating this and will update this thread shortly.
1 Like
eric19
July 12, 2021, 2:08pm
4
screenshot when using the web interface fyi
zaid
July 12, 2021, 6:11pm
5
Hi there, you are receiving this error because the server with the video file is not returning the content-length header.
Stream’s upload-via-link feature requires that the server hosting the original video file return the content-length header.
1 Like
eric19
July 13, 2021, 4:42am
6
Hi Zaid
So that means it might not work on a lot of video links? Because I don’t have control over what headers those servers would return
1 Like
Hi Zaid,
Is content length must === video size in byte?
eric19
July 19, 2021, 2:34pm
8
Hi Zaid
mp4 videos work now after adding a content-length header, but I tried uploading a .mov video with content-length in the header and still got the invalid url error:
curl -I https://d26l66jypm29n.cloudfront.net/lesson/component_set/page/component/file/64/1066795964/0041500233-sas-okc-gm3-play9.nba.qtref.mov
HTTP/2 200
content-type: video/quicktime
content-length: 375
date: Mon, 19 Jul 2021 14:30:03 GMT
last-modified: Tue, 18 Aug 2020 02:55:41 GMT
etag: "ac8f6ced55d9f22d0914df8610ef13fe"
accept-ranges: bytes
server: AmazonS3
x-cache: Miss from cloudfront
via: 1.1 6c12f45af1f84786ea85b2585f1d5df2.cloudfront.net (CloudFront)
x-amz-cf-pop: HKG60-C1
x-amz-cf-id: _ticubHOIamp0wBo0V8ZFWm0h4wgMiCBrWaoGd8aXckAFF7m-BTx2w==
Is there anything else I need to be aware of when uploading .mov files?
I have the same problem
Both of codes below looks the same on the website you posted above, except for the user_agent (i tried many user agents without success)
when i type this on terminal it works:
curl -X POST -d '{"url":"http://170.231.154.230:8181/clipes?file=CUgZx1nwZeTUqgGU.mp4","meta":{"name":"cl8pe"}}' -H "X-Auth-Key: KEY" -H "X-Auth-Email: [email protected] " https://api.cloudflare.com/client/v4/accounts/ACC_ID/stream/copy
my php code below doesnt work:
// $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.cloudflare.com/client/v4/accounts/ACC_ID/stream/copy');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"url\":\"http://170.231.154.230:8181/clipes?file=CUgZx1nwZeTUqgGU.mp4\",\"meta\":{\"name\":\"Clipe\"}}");
curl_setopt($ch, CURLOPT_POST, 1);
$headers = array();
$headers[] = 'X-Auth-Key: KEY';
$headers[] = 'X-Auth-Email: [email protected] ';
$headers[] = 'Content-Type: application/x-www-form-urlencoded';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
return curl_error($ch);
}
curl_close ($ch);
return $result;```