public void DeleteAttachedFileFromListItem(string siteUrl, string webName, int itemId, string attachmentFileName, string listName) { using (ClientContext clientContext = new ClientContext(siteUrl)) { //http://siteurl/lists/[listname]/attachments/[itemid]/[filename] string attachmentPath = string.Format("/{0}/lists/{1}/Attachments/{2}/{3}", webName, listName, itemId, Path.GetFileName(attachmentFileName)); var file = clientContext.Web.GetFileByServerRelativeUrl(attachmentPath); file.DeleteObject(); clientContext.ExecuteQuery(); } }
Search This Blog
Showing posts with label Delete Attached File From ListItem. Show all posts
Showing posts with label Delete Attached File From ListItem. Show all posts
Tuesday, November 8, 2011
Delete Attached File From ListItem
Subscribe to:
Posts (Atom)
Featured Posts
Unlock Hidden Windows Startup and Shutdown Details : How to Enable Verbose Startup and Shutdown Messages in Windows 11
WINDOWS TROUBLESHOOTING · FULL GUIDE Unlock Hidden Windows Startup and Shutdown Details Enable Verbose Status...
-
public struct CoOrds { public int x, y; public CoOrds( int p1, int p2) { x = p1; y = p2; } }
-
LM Studio Overview LM Studio is a desktop application designed for developing and experimenting with large language models (LLMs)...