prototype file upload feature.

also refactored to add put helper function.