views:

268

answers:

2

I am using webclient object to download a file to a windows folder from a sharepoint document library. The credentials I am passing to the webclient object are that of site collection administrator. everything works fine while i test it by uploading a file to the document library. But since the document library is email enabled; when an email is received the file is not transferred to the windows folder. i have put some workflow history events to see which user account is used when the email is received. the user account shown is the network service account. I have given write permissions on the folder to all the users; Everyone, Network service, the site collection administrator user etc. but still i cant figure out what is the problem. If you need to see my code I can post it here.

Please suggest...

A: 

Give it a shot with the System Account (the IIS pool account).

Also, try disabling the Loop Back Check ( http://support.microsoft.com/kb/896861 ), this is root of most problems in SharePoint impersonation.

F.Aquino
already tried giving write permissions to the application pool identity user ... but no luck with that ...
ria
+1  A: 

I'm not exactly sure what your end goal is here or its frequency, but here is a general concept that can be applied to many instances regarding SharePoint and local windows folders.

SharePoint locations are UNC path accessible, so, you could simply try accessing the SharePoint document library via UNC path, then copying the file in question from location A to location B (i.e. using System.IO.File).

Just ensure that whichever account is executing your application, (dependent on the manner in which you are, as this isn't limited to web applications) that it has the necessary permissions to the SharePoint document library location.

Additionally, if your end goal is in actuality something like continuous sync between a document library and a windows folder, you could use the Microsoft Sync Framework or SyncToy (a free implementation of the MSF) to execute syncing (one-way or bidirectional) between the locations at regular intervals.

Joshua
sorry can you please explain sharepoint locations being UNC accessible? how will a document located in a document library like the followinghttp://MySiteName/DocLibraryName/Mydocname.txtwill be accessible through UNC?
ria
i found more info about the UNC paths in sharepoint but sadly i m not able to access my local server doc library as UNC and also the production server doc library ... so i guess this cant b a solution for me :( ... any other suggestions r welcome
ria
that was a good alternative to using webclient ... thanks
ria