服务器数据库中有一批代号相同的零件(设代号为: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();
}
看可以帮你不!
谢谢你的回帖!呵呵~
请恕我不知,该代码能实现创建文件夹吗?呵呵~
很变态的需求~