File Uploads Problems (Groan)

Discussion in 'ASP.NET / ASP.NET Core' started by huckster, Jan 9, 2006.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hello,

    I am using some file upload code that works fine on my development machine and another server, but gives me the error shown below. I have checked the directory permissions and even given the anonymous user WRITE access, but still get the error. I amauthenticating to this directory via the web, as another user whoalso has write access to this directory. What is going on? How could permission be denied when anybody can write to this folder???

    Thanks,
    Huckster


    Note: I have removed my real directory namefor obvious (*cough* security) reasons below.

    ERROR:
    Access to the path 'E:\web\[my site]\htdocs\v2\uploads\e14684f112e34b6298067b8ff97bdf09.xls' is denied.

    CODE:
    string strFileToWrite =Server.MapPath("") + @"\" + System.Guid.NewGuid().ToString().Replace("-","") + ".xls";
    this.UploadedExcelFile.PostedFile.SaveAs(strFileToWrite);


    Post Edited (huckster) : 1/9/2006 7:16:34 AM GMT
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Do you have FrontPage extension enabled? FPSE sometimes messes up permission inheritence which can cause the permission manager to display incorrect permission.

    Create a support ticket and support can confirm that.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Bruce,

    You are correct sir -- I tried a different (non-Front page) directory and it worked fine. You have no idea how much I hate front page extensions ... why can't we all just install our projects by copy-and-paste to a virtual web directory -- I have used this approach before with VS projects and it works a lot better than Front page extensions.


    Thanks for the help,
    Huckster
     
  4. Bruce

    Bruce DiscountASP.NET Staff

    i have to agree w/ you. we hate FPSE as much as anyone!!! Imagine all the users breathing down our neck with unpreditable FP problem!!

    We were at Microsoft couple years ago to preview VS.NET 2005 and when they announced that VS.NET 2005 no longer needs FrontPage extension to upload, everyone in the room applauded.

    Anyhow, MS got the point and added FTP capability to VS.NET 2005.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page