Permissions with Uploading Files

Discussion in 'General troubleshooting' started by kizza, Jan 5, 2010.

  1. 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.
     
    Last edited by a moderator: Oct 14, 2015
  2. Ray

    Ray

    What is the error message you are getting?
     
  3. 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);
    }
     
    Last edited by a moderator: Oct 14, 2015
  4. Ray

    Ray

    Will need the exact error message to help narrow down the problem. It could well be a path issue with the code.
     

Share This Page