.NET Sharepoint Create Directory

I can upload the file to sharepoint with web client as follows

using (System.Net.WebClient webclient = new System.Net.WebClient())
{
    System.Net.NetworkCredential credentials = new System.Net.NetworkCredential(
                    Encryptor.Decrypt(ConfigurationManager.AppSettings["username"]),
                    Encryptor.Decrypt(ConfigurationManager.AppSettings["password"]),
                    ConfigurationManager.AppSettings["domain"]);
    webclient.Credentials = credentials;

    string path = Path.Combine("http://sharepoint.domain.com/dir", filename);
    webclient.UploadData(path, "PUT", fileBytes);
}

But I do not know how to create directories if they do not exist.

Any ideas how I can do this?

Thanks, -c

+3
source share
1 answer

"" SharePoint . - SharePoint - , SharePoint. , SharePoint "", : http://sharepoint.domain.com/dir, , SPSite, "", SPFolders, SPLists, SPDocumentLibraries ..

, " , " SharePoint, WebClient. : Windows SharePoint Services - SharePoint.

, , , , SharePoint. Webservices - , .

, (, SPFolder, SPSite, SPList, SPDocumentLibrary ..).

, , -, :

Administration Service       http://<server-url:port-number>/_vti_adm/admin.asmx
Alerts Service               http://<server-url>/_vti_bin/alerts.asmx
Document Workspace Service   http://<server-url>/_vti_bin/dws.asmx
Forms Service                 http://<server-url>/_vti_bin/forms.asmx
Imaging Service             http://<server-url>/_vti_bin/imaging.asmx
List Data Retrieval Service http://<server-url>/_vti_bin/dspsts.asmx
Lists Service                 http://<server-url>/_vti_bin/lists.asmx
Meetings Service               http://<server-url>/_vti_bin/meetings.asmx
Permissions Service         http://<server-url>/_vti_bin/permissions.asmx
Site Data Service             http://<server-url>/_vti_bin/sitedata.asmx
Site Service                   http://<server-url>/_vti_bin/sites.asmx
Users and Groups Service       http://<server-url>/_vti_bin/usergroup.asmx
Versions Service               http://<server-url>/_vti_bin/versions.asmx
Views Service                 http://<server-url>/_vti_bin/views.asmx
Web Part Pages Service       http://<server-url>/_vti_bin/webpartpages.asmx
Webs Service                   http://<server-url>/_vti_bin/webs.asmx

Workspace.

, .

+3

Source: https://habr.com/ru/post/1707955/


All Articles