implement fileupload feature

I wrote this feature for a class project, and here is a standalone
version.