Clean up file upload code.