Skip to content

Commit 2c34506

Browse files
Merge pull request SharePoint#8692 from bcameron1231/patch-20
Adding DELETE sample for Attachment Files
2 parents 7f2217e + b17a57e commit 2c34506

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

docs/sp-add-ins/working-with-folders-and-files-with-rest.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Working with folders and files with REST
33
description: Perform basic create, read, update, and delete (CRUD) operations on folders and files with the SharePoint REST interface.
4-
ms.date: 08/18/2022
4+
ms.date: 01/12/2023
55
ms.prod: sharepoint
66
ms.localizationpriority: high
77
---
@@ -336,6 +336,14 @@ X-RequestDigest: "{form_digest_value}"
336336
"Contents of file"
337337
```
338338

339+
The following example shows how to **delete a file that is attached to a list item**.
340+
341+
```http
342+
DELETE https://{site_url}/_api/web/lists/getbytitle('{list_title}')/items({item_id})/AttachmentFiles('{file_name}')
343+
Authorization: "Bearer " + accessToken
344+
Accept: "application/json;odata=verbose"
345+
```
346+
339347
## See also
340348

341349
- [Get to know the SharePoint REST service](get-to-know-the-sharepoint-rest-service.md)

0 commit comments

Comments
 (0)