而要開啟另存新檔的對話視窗來下載MP3檔,首先得先建立一個如下的aspx檔﹝在此範例中,命名為ringtone.aspx﹞:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Response.ContentType = "audo/mp3"
Response.AppendHeader("Content-Disposition", "Attachment; FileName=ringtone.mp3")
Response.TransmitFile(Server.MapPath("download/ringtone.mp3"))
Response.End()
End Sub
沒有留言:
張貼留言