服务器数据库中有一批代号相同的零件(设代号为:A),现在在客户端需要下载这些代号为A的零件,那么我在下载的时候能否在客户端机器上自动建立以该图号A命名的文件夹,然后把这批以A为图号的文件放里面?
小弟对ASP知之不多,希望大家能指导下!无限感激!
谢谢~
//下载 =========================================================================================================
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
int i = Convert.ToInt32(this.GridView1.SelectedIndex.ToString());
HtmlImage img = this.GridView1.Rows[i].FindControl("IMG1") as HtmlImage;
string destFileName = Server.MapPath((img.Src));
FileInfo fi = new FileInfo(destFileName);
Response.Clear();
Response.ClearHeaders();
Response.Buffer = false;
Response.AppendHeader("Content-Disposition", "attachment;filename=" + Server.UrlEncode(Path.GetFileName(destFileName)));
Response.AppendHeader("Content-Length", fi.Length.ToString());
Response.WriteFile(destFileName);
Response.Flush();
Response.End();
}
看可以帮你不!