怎么实现上传的文件重新命名后再添加 怎么实现上传文件呢?比如说压缩文件。还有我想实现在用户上传文件后修改它的名字,使文件名递增,该怎么做呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string filename="ccc";//在这可以修改它的名字 string CurrentPath=Server.MapPath("a"); string fullpath=CurrentPath+@"\"+filename; aaa.PostedFile.SaveAs(fullpath); Response.Write(fullpath);<input type="file" id=aaa其中aaa为上传控件的id 楼上正解,然后在命名规则加入System.DateTime.Now.Year.ToString()+System.DateTime.Now.Month.ToString()+;解决…… string newFileName = DateTime.Now.ToString("yyyyMMddHHmmss");//以上传的日期时间命名string serverPath = Server.MapPath("upFiles");//upFiles 为你要上传的目录string fullName = serverPath + @"\"+ newFileName;file1.PostedFile.SaveAs(fullName); 再求一正则表达式 所有接口类型是不是隐式继承自object? 求一SQL语句写法 关于VS2005到2008的升级安装问题 DataList页眉摸板中的控件如何得到 刚做个ajax程序 ,用得着可以下载看看 [求助]怎么使按钮上的字居左对齐呀? 求助!问题有点复杂,希望有人看看。 超级简单问题 请大家帮我看看这个语句的病在哪里 页脚的文本框判断是否是数字 为什么我在[数据访问]中新建一个类,该类不能调用System.Web.HttpContext呢?我应该怎么弄才对?
string CurrentPath=Server.MapPath("a");
string fullpath=CurrentPath+@"\"+filename;
aaa.PostedFile.SaveAs(fullpath);
Response.Write(fullpath);
<input type="file" id=aaa
其中aaa为上传控件的id
string serverPath = Server.MapPath("upFiles");//upFiles 为你要上传的目录
string fullName = serverPath + @"\"+ newFileName;
file1.PostedFile.SaveAs(fullName);