本文介绍了图像没有复制到asp.net的文件夹中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
HI创建
FileUpload newf = new FileUpload();
DayImgName =hewded.jpg;
string fileName_t = Path.Combine(@D:\ images\packages \,DayImgName) ;
newf.SaveAs(fileName_t);
但是图像未复制到该文件夹
HI created
FileUpload newf = new FileUpload();
DayImgName="hewded.jpg";
string fileName_t = Path.Combine(@"D:\images\packages\", DayImgName);
newf.SaveAs(fileName_t);
but the image is not copied to that folder
推荐答案
<asp:fileupload id="issueCommentFileUpload" runat="server" xmlns:asp="#unknown" />
string issuefileName = string.Empty;
if (issueCommentFileUpload.HasFile)
try
{
issuefileName = issueCommentFileUpload.FileName;
string destinationPath = Server.MapPath("./Upload/" + issuefileName);
issueCommentFileUpload.SaveAs(destinationPath);
}
catch (Exception exObj)
{
Response.Write("Some thing wrong");
log.Error("GetIncedencePrimaryInfo method Sql Error : " + exObj.Message.ToString());
}
这篇关于图像没有复制到asp.net的文件夹中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!