Download dialog appears twice

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.
 
S

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top