1
바이트 배열에서 얻은 FileContentResult를 FileStreamResult로 변환하려고합니다. 이것이 가능한가? 그렇다면 어떻게?FileContentResult를 FileStreamResult로 변환하려면 어떻게해야합니까?
바이트 배열에서 얻은 FileContentResult를 FileStreamResult로 변환하려고합니다. 이것이 가능한가? 그렇다면 어떻게?FileContentResult를 FileStreamResult로 변환하려면 어떻게해야합니까?
먼저 MVC에 대해 많이 알지 못하지만 에이 필요 없습니다. FileStreamResult
에 의존하는 코드를 사용하는 경우 FileStreamResult
및 FileContentResult
의 기본 클래스 인 FileResult
에 의존하게 만들 수 있는지 확인하십시오.
하지만 그렇지 않으면, 당신은 항상 사용할 수 있습니다
var streamResult = new FileStreamResult(new MemoryStream(contentResult.FileContents),
contentResult.ContentType)
streamResult.FileDownloadName = contentResult.FileDownloadName;
// You could use an object initializer instead of a separate statement, of course.
어이 이것이 내가 대답 질문 근무! 고마워. :) – SantLev