Question : Why file will not upload to folder on virtual directories?

Error: Access to the path 'C:\Inetpub\wwwroot\wss\VirtualDirectories\80\Upload\SharePoint Lessons Learned.docx' is denied.

I have a custom web part that uploads files to the above path with the above error only when not a farm administrator on SharePoint. Why?  I have a stand alone production server that works fine, but on a 2003 server 32 bit on vmware, it does not. Everything looks the same, except on production server we used multiple system accounts where on development single setup account.  Could that make a difference?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
<appSettings>
    <add key="FeedCacheTime" value="300" />
    <add key="FeedPageUrl" value="/_layouts/feed.aspx?" />
    <add key="FeedXsl1" value="/Style Library/Xsl Style Sheets/Rss.xsl" />
    <add key="ReportViewerMessages" value="Microsoft.SharePoint.Portal.Analytics.UI.ReportViewerMessages, Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=..." />
    <add key="ConnString" value="Data Source=...;Initial Catalog=...;Integrated Security=SSPI;" />
    <add key="ServerName" value="http://..." />
    <add key="filefolder" value="C:\Inetpub\wwwroot\wss\VirtualDirectories\" />
    <add key="Port" value="80" />
    <add key="DirName" value="Upload" />
    <add key="Admin" value="..." />
    <add key="SessionTimeOut" value="20" />
    <add key="FeedCacheTime" value="300" />
    <add key="FeedPageUrl" value="/_layouts/feed.aspx?" />
    <add key="FeedXsl1" value="/Style Library/Xsl Style Sheets/Rss.xsl" />
    <add key="ReportViewerMessages" value="Microsoft.SharePoint.Portal.Analytics.UI.ReportViewerMessages, Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=..." />
  </appSettings>

Answer : Why file will not upload to folder on virtual directories?

Well there is a problem.  It's not the right way to work with Sharepoint.  Consider this because Sharepoint supports WebDAV this is perfectly valid.
http://sharepoint.domain.com/Documents/
or
\\sharepoint.domain.com\Documents\

Also there are free web parts (with source code) like this that upload directly to Sharepoint properly: http://spupload.codeplex.com/

So with options like that why would someone upload to the file system when Sharepoint doesn't support it?  I think it's because the web part developer understood ASP.NET but didn't understand Sharepoint and basically created a hack solution.

Any files uploaded to the file system will not be included in Sharepoint backups and will not be searched by the Sharepoint search engine.

If you hired someone to build the web part, ask them why they didn't do it the Sharepoint way.
Random Solutions  
 
programming4us programming4us