added fs.writeFile to requestHandler.upload