access denied error for file upload

Discussion in 'ASP .Net' started by =?Utf-8?B?aWdvdHlvdXJkb3RuZXQ=?=, Sep 28, 2006.

  1. Ok, here is the issue: I have 2 web pages one does a file upload to a
    database and the other page does a FTP to a server, both pages use the
    c:\temp directory.
    The page that uploads to a database works fine, the page that FTP's the
    files returns me an error (Access denied filename.txt)
    Now the ID has full control of the c:\temp directory. The only
    difference in the 2 pages is that page 2 creates a text file writes data to
    it then FTP's it to the server. What could be causing my 'Access Denied'
    error message?
    =?Utf-8?B?aWdvdHlvdXJkb3RuZXQ=?=, Sep 28, 2006
    1. Advertisements

  2. Hello igotyourdotnet,

    From your description, you got the "access denied" error when running one
    ASP.NET page which upload file to a FTP site. As you mentioned that
    another page upload file to a database works correct and the two pages both
    use the "c:\temp" directory, would you provide some detailed information on
    how does the two pages use the c:\temp directory? For example,

    **whether the two pages will first generate some file from other source and
    put them in the c:\temp dir and then upload it to the target(database or

    ** whether it is possible that the two page will access the same file?

    ** as you said that the problem page will first create a file and write
    data into it, is this created file also used by any other application or

    You can also provide the detailed host environment of your ASP.NET
    application(like server and IIS version ....)

    Generally,for "Access Denied" error, possible causes are security
    permission and file handle locking. I would suggest you try
    troubleshooting the issue step by step. You can first break the code (such
    as the creating file stage and the upload to FTP stage) to see in which
    stage does the "Access Denied" error occur.

    Also, if you have the VS IDE installed on the server that running the
    pages, you can manually attach to the ASP.NET worker process and debug
    through the page code to see at which point does the exception get thrown.

    In addition, for such file access problem, the following tools are useful
    for detecting NTFS file permission error and file handle lock:

    #Filemon for Windows(for detect file access failure)

    #Process Explorer(for check file handle ownership)

    Please feel free to let me know if you have any new finding or questions.


    Steven Cheng

    Microsoft MSDN Online Support Lead


    Get notification to my posts through email? Please refer to

    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Steven Cheng[MSFT], Sep 29, 2006
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U2FyYXY=?=

    Upload a file without file Upload control - ASP.Net

    =?Utf-8?B?U2FyYXY=?=, Aug 2, 2005, in forum: ASP .Net
    Bruce Barker
    Aug 3, 2005
  2. Jay
  3. Pedro Rafael

    file upload(htmlfile: access is denied)

    Pedro Rafael, Sep 22, 2003, in forum: ASP .Net Web Controls
  4. DA
  5. Replies:
    Mar 17, 2005