我知道之前问过的问题,但我没有找到任何解决方案,我在 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;
}
}