How to save a file on client side?
create an asp page "Download.aspx"
In Design side just have
<%
@ Page Language="C#" AutoEventWireup="true" CodeFile="Download.aspx.cs" Inherits="Download" ContentType="Text/xml" %>
Code on CS side
**********
string strFile= "";
if (Request.QueryString.HasKeys())
{
if ((Request.QueryString["vid"] != null) || Request.QueryString["vid"].ToString().Equals("")) // where vid is your querystiing
{
strFile= Request.QueryString[
"vid"].ToString();
}
}
try
{
this.EnableViewState = false;
Response.ContentType =
"text/xml";
string Filename = System.Web.HttpContext.Current.Server.MapPath("test.xml");// your file name
//Filename = Filename + certId + ".vcf";
Response.WriteFile(Filename);
Response.Buffer =
true;
Response.AddHeader(
"Content-Disposition", "attachment; filename=" + Filename );
}
catch (Exception ex) { Response.Write(ex.ToString()); }
Response.End();
**********