Question

I'm trying to create an upload form to send videos to Vimeo.

I've decided to use plUpload because I can easily manage when the upload is complete and handle the subsequent API calls that I need to complete the video upload.

The problem is that when the video has uploaded and I get the "Thanks for uploading!" response, calling vimeo.videos.upload.complete with the ticket and filename returns

Fatal error: Uncaught exception 'VimeoAPIException' with message 'File error'

According to the API docs (https://developer.vimeo.com/apis/advanced/methods/vimeo.videos.upload.complete) it means that the file couldn't be uploaded - but as the upload method returns the "Thanks for uploading!" message I can't see what could be the problem.

plUpload succesfully sends the OPTIONs request; sends the video I'm testing (about 6MB) and gets a 200 OK response. Despite this, sending the video as a standard POST has no issues. Unfortunately because I need to continue with the API calls I can't use this method.

All I need to do is successfully complete the video upload and I'm sorted.

Was it helpful?

Solution

After an exceptional amount of time I've discovered that POST uploads use the File Data Name as file_data whereas Plupload defaults to file.

After using the option file_data_name: 'file_data' in Plupload everything has started to work. Clearly the header wasn't quite what Vimeo's API expected and so it didn't work.

Would have been nice if Vimeo returned something else besides Thanks for uploading! when it doesn't process anything.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top