We help IT Professionals succeed at work.

Uploading files direct from client without using our server

Adam D
Adam D asked
on
I have a service that creates websites for my users.  On this website is a button that allows these users to upload video files.

However, these video files are uploaded to MY server and then sent over (through my server) to the video hosting server.

What I want to figure out is how to bypass using my server as a pass through and have the user upload the file directly from their browser to the video hosting server.

Thoughts?

Thanks.
Comment
Watch Question

Most Valuable Expert 2011
Top Expert 2016

Commented:
What is the URL of the video service upload page?  How do you communicate with that now to send files?  I have used Vimeo for this sort of thing - uploading my files to Vimeo and then giving the links to others.  IIRC you can do this with YouTube.  Your client would just need to post the link to your service after they have uploaded the videos.
Adam DIT Solutions Developer

Author

Commented:
I am using Vimeo for the video hosting.  But, while the button on the users page has the link to Vimeo, since the page is hosted on my server, they push the button, choose their video file, it is pushed from their machine to my server which then pushes it to Vimeo.

So instead, I wanted to somehow avoid the middle man.  Directly send the file from the user/client machine to Vimeo even though the code is sitting on my server.

Does that make sense?

Thanks.
Most Valuable Expert 2011
Top Expert 2016

Commented:
Yes, that makes sense.  Vimeo would become the action= attribute for the <form> tag.  Have you asked Vimeo about this?  I've found their tech support to be very helpful.  Can you show us a link to the way your clients currently upload videos?
Developer & EE Moderator
Fellow 2018
Most Valuable Expert 2013
Commented:
Vimeo and youtube will have api's that allow you to do this.  In this case vimeo https://developer.vimeo.com/api/upload

You will need to create an app with your user account and have it approved before uploading videos according to the documentation for this.

There is a php class and Ray can speak to this better  https://github.com/vimeo/vimeo-php-lib/blob/master/vimeo.php   To start, get familiar with the guidelines https://developer.vimeo.com/guidelines and register your app https://developer.vimeo.com/api
Adam DIT Solutions Developer

Author

Commented:
I haven't fully solved my problem as of yet, but I believe this information will help.  Thanks.