Save uploaded file in main process.