Tag Info

New answers tagged

0

Just tested your REST call in my SharePoint 2013 Enterprise environment and it works correctly. Make sure your list has attachments turned on. List Settings>Advanced Settings> Attachments. Set to Enabled. Make user the Title in the url correctly matches a list in your on-prem site.


2

JSOM var listTitle = 'Tasks' var itemId = 1; var fileName = 'Instruction.docx'; var ctx = SP.ClientContext.get_current(); var list = ctx.get_web().get_lists().getByTitle(listTitle); var item = list.getItemById(itemId); var attachmentFile = item.get_attachmentFiles().getByFileName(fileName); attachmentFile.deleteObject(); ctx.executeQueryAsync( ...


1

I have done it using SPServices and it works fine. Below is the code: $().SPServices({ operation: "DeleteAttachment", listName: "List Name", listItemID: itemId, //list item id url: filePath, //url of attachment that needs to be deleted completefunc: function (xData, Status) { console.log('Deleted'); } }); Source you can ...


1

The thread you have mentioned is a bit misleading. The marked answer will not delete just the attachments but the whole item itself. Is this what you want? To delete just the attachments look at the answer just below the marked answer. That points to an article over here ...


2

Most probably the error File not found occurs since you are trying to retrieve attachments folder that not yet exist in method HasListItemAttachment The following example demonstrates how to upload attachment file via SharePoint JSOM: function processUpload(fileInput, listTitle, itemId,success,error) { var reader = new FileReader(); reader.onload = ...



Top 50 recent answers are included