2012-05-29 4 views
0

파일을 다운로드하려면 page.aspx에 대한 해결책이 필요합니다. 데이터베이스에서 나는 두 필드 : fileMessageName (System.String), fileMessageBytes (System.Byte[])과 함께 '메시지'테이블을 가지고 있습니다. 바이트에서부터 페이지에 실제 파일을 가져와야합니다. ASPX에서이 작업을 수행하는 그러나 당신이 다운로드 새로운 페이지를 추가하는 방법에 대한BLOB에서 다운로드하는 방법은 무엇입니까?

+2

정말 아무것도 시도하지 않았습니다. – leppie

+0

나는 'Response'+ 'MemoryStream'메소드를 시도한다. 흥미로운 파일을 래퍼 (코드 페이지가 아님)에서 다운로드 할 수 있나요? –

답변

1

확실하지

  1. 파일 바이트
  2. 추가 헤더 항목 Content-Type: application/octet-stream
  3. 문서에 데이터를 쓰기 얻기
1

Martin Risell-Lilja 외에도

다운로드 컨트롤러 i N

MemoryStream을

Function File(id As String) As FileStreamResult 
     Dim Icat = New WebClient().DownloadData("https://file.blob.core.windows.net/app/" + id) 
     Dim ms As New MemoryStream(Icat) 
     Return File(ms, "application/octet-stream","Höbölö") 
    End Function 

가져 오기 위해

Function File(id As String) As FileContentResult 
    Dim Icat = New WebClient().DownloadData("https://file.blob.core.windows.net/app/" + id) 
    Return New FileContentResult(Icat, "application/octet-stream") With {.FileDownloadName = "Höbölö"} 
End Function 

: www.mysite.com/Download/File/bidi.exe

당신이 사용자 메타 태그에 권한을 부여하고자하는 또는 다운로드 사용자 정의 옵션을 느리게 할 수있는 경우 .

관련 문제