Hey, I created an ecommerce site with an admin section and am trying to upload images using this admin section, however they are not uploading due to problems with the trust and permissions levels. How can I change the permissions levels so that it works? I have already tried following the advice from here but it didnt work: http://support.Winhost.com/KB/a657/changing-the-default-aspnet-trust-level.aspx Thanks.
I'm using the below code to upload file to Winhost server and it work with no problem: protected void UploadFile(object sender, EventArgs e) { string fname = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName); string path = HttpContext.Current.Server.MapPath("~/uploads/"); FileUpload1.PostedFile.SaveAs(Server.MapPath("") + path + fname); }
Will need the exact error message to help narrow down the problem. It could well be a path issue with the code.