implement the file upload function