none
SharePoint method for removing documents doesn't seem to work since version 2013 RRS feed

  • Question

  • Hello,

    We have an integration with SharePoint which stopped working after SharePoint 2013. In our application we call the following method:

    method=remove+documents%3a12.0.4518.1016&service_name=%2f&url_list=[sites/ASUPublish/Shared Documents/test.docx]

    When this method is executed we get a nice message from SharePoint:

    <html><head><title>vermeer RPC packet</title></head>
    <body>
    <p>method=remove documents:12.0.4518.1016
    <p>message=successfully removed documents
    <p>removed_docs=
    <ul>
    <ul>
    <li>document_name=sites/ASUPublish/Shared Documents/test.docx
    <li>meta_info=
    <ul>
    </ul>
    </ul>
    </ul>
    <p>removed_dirs=
    <ul>
    </ul>
    <p>failed_docs=
    <ul>
    </ul>
    <p>failed_dirs=
    <ul>
    </ul>
    </body>
    </html>

    The problem is, that despite the message 'successfully removed documents' the document is not removed and still stays in SharePoint. Is it a bug in SharePoint or should we use another method for SharePoint 2013 or higher?

    Thursday, March 9, 2017 3:41 PM

All replies

  • Hi,

    In SharePoint 2013, we can use REST service to delete file in document library.

    "/_api/web/GetFileByServerRelativeUrl('/sites/ASUPublish/Shared Documents/test.docx')"

    The following article for your reference:

    SharePoint 2013 working with file and folders: How to delete file from SharePoint document library using REST services

    http://www.sharepointyammertech.com/2015/03/How-to-delete-file-from-SharePoint-document-library-using-REST-services.html

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Friday, March 10, 2017 3:47 AM
    Moderator
  • Hi Dennis,

    Thanks a lot for your suggestion.

    The problem is that we have a lot of customers who upgraded from SharePoint 2010 to SharePoint 2013\2016 recently, and deploying a new code to all of them will be a heavy process. 

    It would be really great to find a solution to make the old approach work. Maybe some SharePoint settings affected the behaviour in SP 2013?

    What is really confusing is that the message returned by SharePoint signifies that the operation completed successfully, so it sounds like a plain SharePoint bug. 

    Friday, March 10, 2017 7:41 AM
  • Hi,

    Please try to install the latest updates for SharePoint 2013.

    https://technet.microsoft.com/en-us/library/mt715807(v=office.16).aspx#BKMK_2013

    Or use Fiddler to monitor the requests and responses.

    http://www.telerik.com/fiddler

    Or provide more details about how to reproduce this issue, others would get easier to research on it.

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Friday, March 10, 2017 8:31 AM
    Moderator