1

I am trying to customize a Document Library Custom View so it shows the items in a specific folder. I managed to do that with SharePoint Designer by changing the Caml Query:

<View Scope="RecusiveAll" ...
<Query>
<where>
    <contains>
        <FieldRef Name="FileDirRef" />
        <Value Type="Lookup">{Folder Name}</Value>
    </contains>
</where>
</Query>
...

So now I get only the documents of this folder.

But when I want to upload a document throw this view the Destination Folder is still the Root. Is there a way to change this? So when I upload a doc by default I get /{FolderName}/ for this specific view? This view will be set on a web part page and the users will use Drag&Drop to upload so I need it to point to the right folder.

Thanks

0

Collaborative Application Markup Language (CAML) is an XML-based language that is used in Microsoft SharePoint Foundation to define the fields and views that are used in sites and lists.

But the Upload.aspx is an application page. It has two query string parameters that identify in which library and folder you will upload file: list and RootFolder.

/_layouts/Upload.aspx?List={List GUID}&RootFolder=<folder>

For example:

http://sp/sites/<site>/_layouts/15/Upload.aspx?List=%7BB3E9A5DE%2D4952%2D4236%2DA005%2DBC8B63D3B3F0%7D&RootFolder=/sites/<site>/Shared Documents/f1

To achieve that, you can add a button/link/custom action for uploading to the specific folder.

You can get GUID of the library by going to the library settings and looking for List parameter List=%7BXXXXXXXX%2DXXXX%2DXXXX%2DXXXX%2DXXXXXXXXXXXX%7D.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.