My ideas

Tuesday, November 21, 2006

How to show a save as in ASP .net

How to show a save as in ASP .net , How to show a SaveAs in ASP .net , How to show a Save Dialog Box in ASP .net , How to show a SaveAs Dialog Box in ASP .net , How to show a Save As Dialog Box in ASP .net.

'ad.xml is a virtual path, on server, or directory that should exist
Dim filePath As String = Server.MapPath("ad.xml")
Dim targetFile As System.IO.FileInfo = New System.IO.FileInfo(filePath)



Response.Clear()
Response.AddHeader("Content-Disposition", "attachment; filename=" + targetFile.Name)
Response.AddHeader("Content-Length", targetFile.Length.ToString)
Response.ContentType = "application/octet-stream"
Response.WriteFile(targetFile.FullName)