VB.Net
Private Sub DownloadFile(ByVal pstrContent As String)
Response.Clear()
Response.ContentType = "application/octet-stream"
Response.Charset = "Shift_JIS"
Response.ContentEncoding = Encoding.Default
Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(DateTime.Now.ToString("yyyyMMdd") + ".csv"))
Response.Write(pstrContent)
'Response.WriteFile(strFilePath)
'Response.BinaryWrite(objFileIO.IFileByte(strFilePath))
Response.Flush()
Response.Close()
End Sub
レスポンス内容タイプ:
"application/msword"
"application/vnd.ms-excel"
"application/pdf"
"application/vnd.ms-powerpoint"
"image/jpeg"
"image/bmp"
"image/gif"
"application/zip"
"text/plain"
"application/octet-stream"
0 件のコメント:
コメントを投稿