0

为什么我在尝试将照片上传到服务器时看到此错误:我有这些代码: 在 Web.config 中:

<configuration> 
    <system.web> 
        <httpRuntime maxRequestLength="2097152" /> 
    </system.web> 
</configuration>

对于上传:

public static void UploadImage(string folder, HttpPostedFileBase file)
    {
        string uploadFolderPath = HttpContext.Current.Server.MapPath("~/Images/" + folder);
        string fileName = Path.GetFileName(file.FileName);
        string filePath = Path.Combine(uploadFolderPath, fileName);
        file.SaveAs(filePath);
    }

错误是: 在此处输入图像描述

编辑:

我有一个名为的域taghbazar.ir和一个主机。我购买了另一个名为的域uask.ir并将我的托管空间从更改taghbazar.iruask.ir。我认为问题就在那里。如何解决?错误说:

在此处输入图像描述

4

0 回答 0