Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   access denied error for file upload (http://www.velocityreviews.com/forums/t372754-access-denied-error-for-file-upload.html)

=?Utf-8?B?aWdvdHlvdXJkb3RuZXQ=?= 09-28-2006 02:55 PM

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

Steven Cheng[MSFT] 09-29-2006 03:42 AM

RE: access denied error for file upload
 
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/Utilitie...sExplorer.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/subscripti...ult.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/subscripti...t/default.aspx.

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



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















All times are GMT. The time now is 04:15 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.