Home > PHP > Updates on the HTTP file upload front, part 2

Updates on the HTTP file upload front, part 2

December 3rd, 2008 Leave a comment Go to comments

Continuing from http://michaelshadle.com/2008/11/26/updates-on-the-http-file-upload-front/ ...

I've been doing some research and more hacking. Code should find its way out there sometime soon. Here's my notes since the last installment of the "As The File Upload World Turns"

  • Figured out the appropriate nginx configuration so there is no buffering to disk of the request.
  • Rudamentarily tested browser memory while uploading a 220 meg file - did not appear to use much more than normal (which leads me to believe that Gears is slicing the file up efficiently enough and only grabs the bytes it needs)
  • HTTP authentication will not work. From what I could understand from the code and some random comments, authentication information is not supported by Gears' XHR object.
  • Pause/resume is possible; I've changed the PHP server side piece to accept the byte offset Gears tells it to start at; originally was having issues until I determined why it wasn't fseek()'ing properly 🙂 However this still requires a more stateful approach on the client side. Will probably have to implement a local Gears database and possibly a worker pool setup. This will allow for persistence and other neat things.
  • I've got a decently functioning JavaScript UI which seems to calculate out the average speed, estimated time remaining, etc.

The only thing missing is a better attempt to see if Gears will retry the upload on a failure. I believe it is possible when dealing with a worker pool but this is -very- basic XHR usage at the moment. Perhaps since it is JavaScript-based we can add in our own re-transmission code. That's the next piece I'm going to mess around with.

Stay tuned for the results... (and code, most likely!)

Categories: PHP
  1. Robert Redl
    January 15th, 2010 at 12:12 | #1

    Interesting Project. Do you have results publishedsomewhere? Greetings from Vienna, Austria, Robert

  2. mike
    January 15th, 2010 at 13:27 | #2

    Actually, my team at work looks like they're gong to work on something else, as Gears support has been dropped by Google in favor of HTML5. We need something cross-browser/cross-platform and as of right now some people are reporting issues installing Gears (not sure why) and Gears does not work on Snow Leopard.

    The same principles apply, it will most likely be written in Java though as every other client-side applet possibility has issues barring it from being an option. Gears was our slimmest and best option. It works great if you have it installed, and the amount of PHP and JavaScript are minimal.

  3. Puma
    May 21st, 2010 at 02:19 | #3

    any news about this project? id like to use such a script

  4. mike
    May 21st, 2010 at 12:26 | #4

    Unfortunately no. Since Gears is not being supported further by Google in an effort to push HTML5, we haven't done anything further on this. There was supposed to be a lightweight Java-based thing for more universal compatibility and Java was the only option that has both the client-side universality and the features such as chunking, etc.

    My hope is that it will be developed at some point and we can share it with the world. But nothing has moved forward so far...

  1. No trackbacks yet.
You must be logged in to post a comment.