Fix upload_file method