我可以上传文件(下面的源文件已上传我用 rdp 检查过。)但我无法在浏览器(.docx)中访问它:找不到文件或目录。我应该怎么办
protected void Button1_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
try
{
string filename = Path.GetFileName(FileUpload1.FileName);
FileUpload1.SaveAs(Server.MapPath("~/") + filename);
Label1.Text = "Upload status: File uploaded!";
}
catch (Exception ex)
{
Label1.Text = "Upload status: The file could not be uploaded. The following error occured: " + ex.Message;
}
}
}