Gravedigger
Gravedigger

Reputation: 57

Ajax youtube upload

I'm trying to implement resumable video upload to Youtube, as described here: youtube resumable upload api .
But I am getting error: "NetworkError: 404 Not Found - http://uploads.gdata.youtube.com/resumable/feeds/api/users/default/uploads".
Here is code:

    var http = new XMLHttpRequest(); 
    var url = "http://uploads.gdata.youtube.com/resumable/feeds/api/users/default/uploads";   
    http.open("POST", url, true);
    http.setRequestHeader("Host", "uploads.gdata.youtube.com");
    http.setRequestHeader("Authorization", "AuthSub token=\"yDXi4sfOb8RYWDIH....MEAxMzE0MzAzMDEy\"");
    http.setRequestHeader("GData-Version", 2);
    http.setRequestHeader("X-GData-Key", "key=DI39si4Tl....18OaRy");
    http.setRequestHeader("Content-length", 0);
    http.setRequestHeader("Slug", "test.avi");
    http.send(null);

I would be grateful for the help.

Upvotes: 1

Views: 742

Answers (1)

mjhm
mjhm

Reputation: 16705

The resumable upload and direct upload facilities are not supported from browsers -- in particular they violate browser same origin policies. You need to either use the browser based uploading or proxy the uploads through your server.

Upvotes: 1

Related Questions