我正在网站上工作,您可以将多个PDF文件合并到一个文件中,
但我遇到的问题是每次尝试上传文件时都会收到此错误:
Could not find file 'C:\Program Files (x86)\IIS Express
我已从此路径上传文件(C:\ Program Files(x86)\ IIS Express)以使其正常工作。
我的代码:
protected void Button1_Click(object sender, EventArgs e)
{
string filepath = Server.MapPath("\\Upload");
HttpFileCollection uploadedFiles = Request.Files;
Span1.Text = string.Empty;
for (int i = 0; i < uploadedFiles.Count; i++)
{
HttpPostedFile userPostedFile = uploadedFiles[i];
if (userPostedFile.ContentLength > 0)
{
userPostedFile.SaveAs(filepath + "\\" + Path.GetFileName(userPostedFile.FileName));
Span1.Text += "Location where saved: " + filepath + "\\" + Path.GetFileName(userPostedFile.FileName) + "<p>";
}
}