Finished (and tested) upload functionality!