views:

172

answers:

6

Hi folks,

I code primarily in PHP and Perl. I have a client who is insisting on seeking video submissions (any encoding) from the public via one of their pages rather than letting YouTube do its job.

Server in question is a virtual machine and I can adjust ini settings for max post, max upload size etc as needed.

My initial thought is to use a Flash based uploader with PHP on the back end but I wondered if someone might have useful advice and experience on the subject?

Peace

JG

+2  A: 

You can adjust the post size and use a normal html form. The big problem is not Apache, its http. If anything goes wrong in the transmission you will have no way to detect the error. Further more there is no way to resume the transfer. This is exactly why BitTorrent is so popular.

Rook
You can't say BitTorrent is an ideal protocol for file uploads on the web. Besides the fact it's not integrated in any browser, it relies on multiple seeds to perform well.
spoulson
@spoulson Opera comes with a BitTorrent client. But that's besides the point. The real point is that HTTP won't be able to handle large uploads and you must seek any other protocol. Maybe ftp but that protocol is very primitive compared to BT.
Rook
+2  A: 

Doing large file transfers of HTTP is not usually fun -- but sometimes it's necessary.

For large files, you'll definitely want to provide some kind of progress gauge for end-users.

There are flash-based tools that do this (swfUpload comes to mind).

If you want to avoid flash and do it with pretty html/javascript/css, you can leverage PHP's APC extension, which for some reason provides support for getting upload status from the server, as explained here

timdev
+1  A: 

I don't know how against youtube your client is, but you can use their api to do the uploads from a page on your site. http://code.google.com/apis/youtube/2.0/developers_guide_protocol.html#Uploading_Videos

See: browser based uploading.

Syntax Error
That is a very cool link! Thanks!
jerrygarciuh
+1  A: 

For web-based uploads, there's not many options. Regardless of web platform, web server, etc. you're still transferring over HTTP. The transfer is all or nothing.

Your best option might be to find a Flash, Java, or other client side option that can chunk files and upload them piecemeal, then do a checksum to verify. That will allow for resuming uploads. Unfortunately, I don't know of any such open source component that does this.

spoulson
Are you seriously are proposing that someone write their own chunked/checksumming protocol instead of using an open source one like bittorrent?
Rook
I'll be convinced if you can show me a site that seamlessly integrates a BitTorrent upload protocol.
spoulson
@spoulson you should write your own compiler for your own protocol so you can send picture of the wheal you just re-invented to friends and family.
Rook
+1  A: 

Try to convince your client to change point of view.

Using http (and the browser, hell, the browser!) for this kind of issue is rarely a good deal; Will his users wait 40 minutes with the computer and the browser running until the upload is complete?

I dont think so.

Maybe, you could set up a public ftp account, where users can upload but not download and see the others user's files.. then, who want to use FTP software can, who like to do it via browser can too.

The big problem dealing using a browser is that, if something go wrong, you cant resume but have to restart from zero again.

the past year i had the same issue, i gave a look to ZUpload , but i didnt use it so i can suggest (we wrote a small python script that we send to our customer; the python script create a torrent of the folder our costumer need to send to us, and we download it via utorrent ;)

p.s: again, sorry for my bad english ;)

DaNieL
A: 

I used jupload. Yes it looks horrible, but it just works.

With that said, it's still a better idea to convince the client that doing so is stupid.

Lo'oris