This project has moved. For the latest updates, please go here.

Deleting documents

Jun 20, 2014 at 2:00 PM
Edited Jun 20, 2014 at 2:02 PM

Found a frustrating issue when deleting documents today - it seems that the BatchCMD xml really doesnt like the escaped '%20' space. Also found the solution - sharing so that this might help others.

Tried to follow the steps in this link - which correctly say that you need to pass the ID and the fileRef to the Batch cmd:

However, we hit a problem when the fileRef contains '%20' - since the library and filename contained a space.

If the ID and fileRef are themselves read from a 'getListItems' and the document library or fileRef contains a space '%20' - then the delete throws a 'do not have permissions' error.

A simple function is needed to parse the fileRef and replace '%20' with a space before passing the batchCMD xml.

Jun 21, 2014 at 2:59 AM
If you decode the URL prior to passing it in, it should work:
var url = "http://server/site/Lists/Working%20Docs";


I don't think I've ever ran into this problem, so the actual answer may be something else altogether. Whatever you find out, post back.