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

Upload Acces-Control-Access-Origin Error #38

Open
rnvarma opened this issue Jun 14, 2016 · 9 comments
Open

Upload Acces-Control-Access-Origin Error #38

rnvarma opened this issue Jun 14, 2016 · 9 comments

Comments

@rnvarma
Copy link

rnvarma commented Jun 14, 2016

I am running a local server on localhost:8000 and initializing the library with the clientID, clientSecrets, and accessToken. When I make the streamingUpload API call on a video uploaded by a user, I get the following error messages in my chrome developer console.:

XMLHttpRequest cannot load https://api.vimeo.com/me/videos. Response to preflight request doesn't pass access control check: A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true. Origin 'http://localhost:8000' is therefore not allowed access. The credentials mode of an XMLHttpRequest is controlled by the withCredentials attribute.

Uncaught TypeError: res.setEncoding is not a function

Uncaught Error: Network error

Any idea what might be causing this?

@Dashron
Copy link
Contributor

Dashron commented Jun 14, 2016

It sounds like you are trying to use this library from your browser? Is this correct? (maybe with browserify or something).

@rnvarma
Copy link
Author

rnvarma commented Jun 14, 2016

Yes the API is being called from javascript which is running in the browser. Is that not supported?

@rnvarma
Copy link
Author

rnvarma commented Jun 14, 2016

For some more information: the web app has a django backend and is using webpack to build the javascript files (react frontend) to then be loaded in the html templates.

@Dashron
Copy link
Contributor

Dashron commented Jun 15, 2016

Correct, we don't currently support using this library in the client. I believe we have seen this error in the past though, so I'll have our developers dig in further and see why you can't make an AJAX call to /me/videos.

@rnvarma
Copy link
Author

rnvarma commented Jun 15, 2016

So if I want a user to upload a video from our website, would I have to upload the video to our server and then upload it through the API on the server side?

@Dashron
Copy link
Contributor

Dashron commented Jun 15, 2016

That's the currently 100% supported flow. We will be releasing client side logic in the future, but for now the closest option is https://github.com/websemantics/vimeo-upload. This library has client side upload, but transmits the access token to the client. Really only the upload url should be transmitted to the client.

@imaksp
Copy link

imaksp commented Jul 30, 2016

As per vimeo official guide video upload is supported through HTTP PUT directly from client, you can get secure upload url from node server so you don't need to pass access token to client.
https://developer.vimeo.com/api/upload/videos#resumable-http-put-uploads

@vycoder
Copy link

vycoder commented Nov 8, 2018

Any news on this? I encountered the same problem. I need to upload a video via my SPA website. I also get the same error even on production whenever I do a PATCH request. The initial POST /me/videos is working though.

@vycoder
Copy link

vycoder commented Nov 8, 2018

I tried vimeo_upload and it seems like it's not compatible with latest 3.4 accounts Issue 31. Went back here and found this PR #86. I tested it and it's pretty much solves my problem of uploading videos via my client SPA website.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants