tag:blogger.com,1999:blog-1705051721030116110.post573264529494518813..comments2023-12-19T17:25:23.739-08:00Comments on Development Hole: Delete SharePoint Document Library Files Programmaticallytxs8311http://www.blogger.com/profile/07046898420109468604noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-1705051721030116110.post-21289202988937106512010-04-22T09:52:31.760-07:002010-04-22T09:52:31.760-07:00Odd...I get successful return but the document is ...Odd...I get successful return but the document is not deleted. Any idea why?Unknownhttps://www.blogger.com/profile/07057792502970177375noreply@blogger.comtag:blogger.com,1999:blog-1705051721030116110.post-18564481642036085412008-05-01T17:55:00.000-07:002008-05-01T17:55:00.000-07:00Christoph,There are a couple of ways of splitting ...Christoph,<BR/><BR/>There are a couple of ways of splitting the Url into file and web paths.<BR/><BR/>The <A HREF="http://msdn.microsoft.com/en-us/library/ms947554.aspx" REL="nofollow">urlToWebUrl</A> will do this for you. The POST url for this method would be something like:<BR/><BR/>Uri uri = new Uri(url);<BR/>string webUrl = string.Format("{0}://{1}", uri.Scheme, uri.Authority);<BR/>string postUrl = webUrl + "/_vti_bin/shtml.dll/_vti_rpc";<BR/><BR/>A second approach is covered in <A HREF="http://geek.hubkey.com/2007/11/upload-file-to-sharepoint-document.html" REL="nofollow">this post</A> - take a look at the GetWebURL method.txs8311https://www.blogger.com/profile/07046898420109468604noreply@blogger.comtag:blogger.com,1999:blog-1705051721030116110.post-78225354524557746722008-04-29T05:16:00.000-07:002008-04-29T05:16:00.000-07:00This is a great solution, but I have a problem to ...This is a great solution, but I have a problem to use this WebClient if I only get the full URL of the item to be deleted.<BR/><BR/>Is there a possibility to identify what part of a url is the webRelativeUrl-Part and the documentLibrary-Part? <BR/><BR/>A URL http://localhost/Subsite/DocLibraryName/SubFolderInDocLib/Document.txt can not be split in this two parts!?Christophhttps://www.blogger.com/profile/06385035900618657896noreply@blogger.comtag:blogger.com,1999:blog-1705051721030116110.post-69928629364856183932008-03-26T12:22:00.000-07:002008-03-26T12:22:00.000-07:00The parameter webRelativeUrls is the url (or array...The parameter webRelativeUrls is the url (or array of urls) of the file(s) you want to delete. For example, to delete the file "test.txt" in the document library "Docs" you could use the following code:<BR/><BR/>string result = "";<BR/>Remove("http://localhost", out result, "Docs/test.txt");<BR/><BR/>To delete 2 files:<BR/><BR/>string result = "";<BR/>Remove("http://localhost", out result, "Docs/test1.txt", "Docs/test2.txt");txs8311https://www.blogger.com/profile/07046898420109468604noreply@blogger.comtag:blogger.com,1999:blog-1705051721030116110.post-72390634468063571212008-03-26T07:16:00.000-07:002008-03-26T07:16:00.000-07:00what is the parameter names webRelativeUrls, i'm n...what is the parameter names webRelativeUrls, i'm not yet be able to delete the document.<BR/>Can i use the remove method with the Part-I.Anonymousnoreply@blogger.com