I have the following method:
private string SubirImagem(string imagemupload, string sequencia, string clifor)
{
HttpPostedFile imagem = Request.Files[imagemupload];
string nomeimagem = "";
if (imagem != null && imagem.ContentLength > 0)
{
string extimagem = Path.GetExtension(imagem.FileName).ToLower();
nomeimagem = clifor + '_' + sequencia + extimagem;
imagem.SaveAs(Server.MapPath(Path.Combine("/Uploads", (nomeimagem))));
}
return nomeimagem;
}
Location this method is working normally, hosted it is presenting error reporting that I am not allowed to write to folder:
System.UnauthorizedAccessException: Access to the path "hijackserver" \ httpdocs \ Uploads \ 510247_1.png is denied.
Would you like to know how to save on a relative path? Or some other way to do the above method.