views:

147

answers:

3

Hello all,

I am working on a website, using PHP/MySQL, where users can upload videos, then, those videos are converted (using FFMPEG) to FLV and MP4 files.

Now, the whole 'upload' and 'conversion' process takes place on a different (remote) server that is actually being hosted by a different provider.

The reason I am using a different hosting location is because they offer more storage and the conversion features.

My question is this: How (or what is the best way) that I can upload files to my 'video hosting site' from the main website where the users primarily interact? Additionally, when videos are uploaded, information is added to the database as well (Video Title, Description, etc), so how would I enter this info into the database? From the remote location or the main site?

Also, how can I do this securely? Meaning, someone cannot just 'browse' to the video site and randomly upload a file.

Or, if someone has a completely different, constructive recommendation, I'd much appreciate that as well.

Many thanks!

+4  A: 

Use FTP to get the files from one host to another. That's what this protocol was designed to.

RaYell
+1  A: 

I agree with RaYell. Provide an interface where your content provider can add a video's metadata. Within the interface, add a field where they can upload the media file. Once the form is submitted, validate and sanitize the data, store it in your database and then open an FTP(or SFTP) connection using PHP and push the content to your external hosting provider.

Wilhelm Murdoch
+2  A: 

I agree with RaYell. Some security notes:

Let your customers do the upload to server1 (the webserver) and push the files from server1 to server2 (the video server). You can then configure the video server to only accept FTP connections from the webserver, but you will transfer the files twice.

If you really want to transfer the files directly to the video server, you should look into using Secure FTP or SSH FTP.

Residuum