Monday, July 19, 2010

SharePoint Document Library and physical folders

Scenario:
This is 5am and my friend asked me "Is it possible to create directory in share point where user can upload some document new files and they get synced with some physical folder for further processing by other LOB systems."

Solution:
Even though there can be many solutions to thsi kind of situation. I am listing a few here.

1. I will recommend not to create a physical folder and adjust the foreign process to read directly from SP Document Library ( 20 lines of code ). In case this is not possible for any reason, try other options

2. Create a new Visual Webpart/User Control to provide a UI for uploading a document and directly to the physical folder. This is kind of pure ASP.Net approach. Disadvantage of this approach will be that there is no copy retained in SharePoint.

3. Incase you want to retain a copy in Sharepoint also

3a. Modify the above Webpart/User Control to create copies in physical folder and sharepoint document library

3b. Provide a document library for user to upload documents and Create a Window Service with Timer to poll this document library for any changes and sync physical folder accordingly.

4. We can write event handler/workflow on the designated document library . Thanks to Gaurav suggesting this. ( It was 5 am and I was sleepy :) )

Any other thoughts ? Welcome :)

6 comments:

Gaurav July 19, 2010 at 9:19 AM  

How about writing event handlers on the document library?

Sandeep July 19, 2010 at 9:26 AM  

Thanks Gaurav, I have updated post

Mahmoud Aleryan July 20, 2010 at 2:15 AM  

I Propose the following:
1- Create a SharePoint Document library
2- Map this document library as a network drive

Now,you have the SharePoint document library as a Physical folder.

I Hope that this helps you.

Sandeep July 20, 2010 at 3:04 PM  

Thanks Mahmoud, Infact when I updated my blog yesterday I thought about it, but trust me it has soooooo many security issues.

Unknown May 7, 2011 at 4:40 PM  

What about uploading 4-9gb files. sharepoint max is 2gb. I want to store 9gb files and force sharepoint to store uploaded files to a physical folder on the server.

Sandeep May 8, 2011 at 1:05 AM  

Derek,

You should look into Remote BLOB storage options in which larger files are automatically stored in physical folder rather than in DB.

Sandeep