R – Access network folder programmatically WSS 3.0 sharepoint

shared-directorysharepoint

I want to create a web part which will contain a button, on click of that button I want to access the network folder and apply the business logic such as create a file/folder, delete a file/folder e.t.c.

I do have created such kind of web part but it's giving error like "Could not find a part of the path '\comp01\ibc'" while accessing the network folder. I am using a name space System.IO for file related activities. I found a weird behavior like this web part works fine on another wss server.

Is share point requires any kind of privileges to access the network folder?
I am using a windows authentication not forms based authentication.

Please help me in this regard.

Best Answer

Where are you trying to Create the Folder in the SharePoint Server or a Different Server?. Check if you are accessing the path using UNC \ format, make sure that the permission has been configured. Also there is a chance that impersonation is not configured to have rights to create the folder, check the App Pool User account permission. Finally you can try to run the code with elevated permission ( have this as last option)