Finish up file upload directive, fix #374