小编has*_*him的帖子

错误:访问路径“G:\PleskVhosts\smartheat-eg.net\httpdocs\SolutionsImages\1049sTulips.jpg”被拒绝。在 GoDaddy 服务器中

我在 godaddy.com 上托管,

我已联系 GoDaddy 的支持,但没有解决方案,此代码在本地计算机上运行没有任何问题

这是我将图像上传到此路径的代码:

  if (uploadImageSolution.HasFile)
        {
            try
            {
                if (uploadImageSolution.PostedFile.ContentType == "image/jpeg" ||
                    uploadImageSolution.PostedFile.ContentType == "image/.jpg" ||
                    uploadImageSolution.PostedFile.ContentType == "image/.psd" ||
                    uploadImageSolution.PostedFile.ContentType == "image/.png" ||
                    uploadImageSolution.PostedFile.ContentType == "image/.gif")
                {
                    if (uploadImageSolution.PostedFile.ContentLength < 8100000)
                    {
                        string filename = Path.GetFileName(uploadImageSolution.FileName);
                        uploadImageSolution.SaveAs(Server.MapPath("~/SolutionsImages/"+ _ID + "s" + filename));

                    }
                    else
                    {


                    }
                }
            }
            catch (Exception ex)
            {
                imgmsg.Text = ex.Message;
            }
        }
Run Code Online (Sandbox Code Playgroud)

.net c# asp.net path

1
推荐指数
1
解决办法
4545
查看次数

标签 统计

.net ×1

asp.net ×1

c# ×1

path ×1