This project is read-only.

External file store

Feb 25, 2009 at 9:06 AM
Hi all,

Can any one help me on this.

I have my sharepoint and media file store in different server. Now i need to configure my PKS moss site to store the media files in different server.

i have used the fallowing steps but didn't worked.

1)creted uploadfiles in secound server, created shared and given full permission to administrator of my sharepoint server.
2)then i used \\servername\fileupload vale for the field   Local File settings of PKS  Podcats list.
3) i have received fallowing exception

    Check if the Upload Location URI exists. If network share, make sure you are authenticated to the share.   at Microsoft.MSIT.NetworkFileStore.FilesUploadPropEditControl.ValidateInput()
   at Microsoft.MSIT.NetworkFileStore.FilesUploadPropEditControl.OnSaveChange(SPField field, Boolean isNewField)
   at Microsoft.SharePoint.ApplicationPages.FieldEditPage.BtnOk_Click(Object sender, EventArgs e)
   at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Feb 25, 2009 at 8:21 PM
From what I can tell from the code, the file share is accessed by the currently logged on user (ie. the user logged onto SharePoint).  Because the share is a network resource - you MUST setup kerberos in SharePoint so that the credentials are passed onto the next hop (ie. the file share), as well give anyone who is going to log onto SharePoint access to the file share.
Mar 4, 2009 at 8:23 PM
Actually, it is a code bug in releases previous to Februaury, you shouldn't have to set up kerberos. The code is not elevating permissions when it goes to check if the URI exists.

If you download the code, you can open the NetworkFileStore solution in PKS Prerequisites, then open the FilesUploadPropEditControl.cs

I don't remember the method name right now, but if you search for "Directory.Exists" you'll find it.

Then just wrap that block of code in:

SPSecurity.RunWithElevatedPrivileges(delegate()
{
    [ code that checks the uri ]
});

Then recompile and copy the DLL to your web front-end server and drop in the c:\windows\assembly folder and reset iss and it should start working.

Note: You will probably have trouble opening the source code. It still has all the Team System source control bindings to the server the current dev team is using. Also, you have to hand edit the .csproj file and change the <Import Project="..." /> node to point the correct targets file: <Import Project="..\..\RatingsSource\MSBUILD\Microsoft.InformationServices.CSharpCAB.targets" />
Mar 4, 2009 at 9:52 PM
This will then also throw the same error when trying to write or read the file system, as both of these functions dont impoersonate either.  Kerberos fixed this issue for all code paths that talked to the file system.
Mar 5, 2009 at 12:08 AM
We had a situation where we were using Forms authentication, so Kerberos wasn't an option...

You can't use the Silverlight Upload method, but for me, HTTP upload worked fine once the above code fix was put in.