Documents, files, and tomorrow’s web browser
August 20th, 2009 by Bobby WhitmanUploading a file in the browser is something that most of us take for granted. Whether its attaching a file in a web-based e-mail program or updating your Facebook profile pic, it’s something we do nearly every day.
Technically speaking, there is a bit more to it than that, but luckily for us web developers it just sort of happens, you pop an <input type=”file” /> tag into your HTML and the file magically appears on your web server in a spot that’s not too difficult to find.
The problem is that the traditional browser upload is very limiting. What if I want to attach 20 pictures to the same e-mail? Or, how about getting a progress bar for those larger uploads? If the upload fails how do I know what went wrong?
Well, recently we’ve been seeing a solution, use Flash. The FileReference object in ActionScript can do all of these things. And, yeah, it’ll work just fine, but wouldn’t it be convenient if browsers could just handle these things naturally?
Short answer: yes. And the W3C thinks so too as they are in the process of compiling a File API. From the looks of things accessing file information before anything has been transferred to the server will become trivial.
However, if you read a bit deeper into things, you’ll see this provides for a much deeper browser integration with your computer’s file system. The ability for the browser to read (and perhaps write) file data directly to/from the end-user’s machine is in the works here.
With such features we will greatly advance the strength and possibilities of web applications. Things like Google Gears, as cool as they are, won’t be necessary because the browser will handle it on its own.