Download dialog appears twice

  • Thread starter Thread starter Sharon
  • Start date Start date
S

Sharon

Hi all.
I have an aspx page that starts a download:
Response.WriteFile(file).
The problem is that the Open / Save dialog appears twice when i choose Open.
Any idea why?
10x.
Sharon.
 
Private Sub downloadLink_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Utils.downloadAttachment(ViewState("attFileName"), Me.Context)
End Sub

'attachment file download
Public Shared Sub downloadAttachment(p_fileName As String, p_ctx As
HttpContext)
Dim fileFullName As String = m_attachmentFolder & p_fileName
Dim origFileName As String = p_fileName.Remove(0, 38)

If File.Exists(fileFullName) Then
p_ctx.Response.BufferOutput = false
p_ctx.Response.ContentType = "application/octet-stream"
p_ctx.Response.AddHeader("Content-Disposition", "attachment;filename=" &
origFileName)
p_ctx.Response.WriteFile(fileFullName)
p_ctx.Response.End()
End If
End Sub
 
Back
Top