access denied error for file upload

G

Guest

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 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'
error message?
 
S

Steven Cheng[MSFT]

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
FTP)

** 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
page?

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)
http://www.sysinternals.com/Utilities/Filemon.html


#Process Explorer(for check file handle ownership)
http://www.sysinternals.com/Utilities/ProcessExplorer.html

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


Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



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
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top