public ActionResult Post([FromForm] RoverFiles file) { try { if (file.FormFile == null) { return(BadRequest("Error: Please upload a File ")); } _navigationService.AssignPlateau(file.PlateauHeight, file.PlateauWidth); var instructions = _fileReaderHelper.ReadInstructionsFile(file.ConvertToByteArray(), file.FileName); var stringBuilder = new StringBuilder(); stringBuilder.AppendLine(string.Format("for Plateau ( {0} , {1} ) File: {2} ", file.PlateauWidth, file.PlateauHeight, file.FileName)); stringBuilder.Append(_navigationService.ReceiveMultipleInstructions(instructions)); return(Ok(stringBuilder.ToString())); } catch (InvalidFileException e) { return(BadRequest("Error: Invalid File. Please Update a .csv file with 1 column named Instruction")); } }