access denied error for file upload
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
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 asp.net 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'
RE: access denied error for file upload
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.
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.
|All times are GMT. The time now is 12:17 AM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.