Skip to main content
10 votes
Accepted

Missing delete attachments button

It's a normal behavior with the recurrence events when you try to edit a specific one event in the Event series ! So you should be aware of the following : If the file attached for a specific event ...
Mohamed El-Qassas MVP's user avatar
7 votes

How to resolve "The property or field 'ListItemCollectionPosition' has not been initialized.." error?

You can include it like below. clientContext.Load(listItems,items => items.Include(item => item.Id), items => items.ListItemCollectionPosition);
user64384's user avatar
7 votes
Accepted

SPFX: How to add item in SharePoint list with attachment?

Ronak, Working with attachments can be frustrating, but I have found that using the awesome PnP library makes it easy. Here's a quick summary of how to do it: Install the sp-pnp-js library by using ...
Hugo Bernier's user avatar
  • 1,246
6 votes
Accepted

Is there a way to show the actual Attachment links inside the list view for my custom list

Option 1 - not sure why its showing error, works at my end. Could be something to do with jquery loading issue. You can the below jsLink to show the attachments: (function () { (window.jQuery ...
Gautam Sheth's user avatar
  • 30.9k
4 votes
Accepted

Remove the option to delete attachment on Edit Form

You can do it with this piece of css: .ms-delAttachments { display: none; } You can open the edit form in the Advanced mode in SharePoint designer, find the <SharePoint:StyleBlock runat="server"&...
Damjan Tomic's user avatar
  • 3,656
3 votes
Accepted

Getting error of 'Column 'Attachments' does not exist. It may have been deleted by another user.' when calling REST API

Looks like you are missing the Attachments column in the API. Try it as below: http://<SITE>/_api/web/lists/getbytitle('Narrative%20Framewo‌​‌​rk')/items ?$select‌​=Lookup1/Title,Looku‌​p2/...
Gautam Sheth's user avatar
  • 30.9k
3 votes
Accepted

Handle ListItem attachments via CSOM

Please use below code: foreach (AttachmentFile file in data.NewAttachments) { var attInfo = new AttachmentCreationInformation(); attInfo.FileName = "Name"; attInfo.ContentStream = new ...
Samir Khimani's user avatar
3 votes

Linking from List Item to Multiple Documents in SharePoint Online

The approach with separate document library is definitely better than the one with attachments. You should create a document library, enable content types (Document library settings -> advanced ...
Damjan Tomic's user avatar
  • 3,656
3 votes

Placing a hyperlink (to click on) for an attachment in list view

Please follow these steps to display attachments in new column. Create a Multiple lines of text with rich text option column. Example I have created ‘ItemAttachments’. Reason of creating it as ...
Saira's user avatar
  • 608
3 votes

Upload Attachment field to SharePoint

Following is jQuery example of attaching file via REST <input type="file" id="fileUpload1" /> <input type="submit" id="buttonClick" onClick="buttonSubmitClick()" /> <script type="...
Arsalan Adam Khatri's user avatar
3 votes
Accepted

add attachments with javascript on item edit

You can create a custom File Upload control <input id="file_input" type="file"> (if you want to upload multiple files, use "jquery.multifile.js" plugin). Get files from the custom control and ...
JoannaW_MSFT's user avatar
  • 6,621
3 votes
Accepted

Copy attachments from list to another list

You can do it with following code: foreach ($AttachName in $item.Attachments) { $spFile = $item.ParentList.ParentWeb.GetFile($item.Attachments.UrlPrefix + $AttachName); $newItem.Attachments....
Damjan Tomic's user avatar
  • 3,656
3 votes
Accepted

Convert SharePoint file object into hex string

Found an answer for this. I need this to send attachment from SharePoint list item to SQL in varbinary(MAX) field. Converted file into ByteArray and then converted it to string $fileInfo = [Microsoft....
Bhaskar Dhone's user avatar
2 votes
Accepted

New item saving sometimes hangs when there is an attachment

I've had this problem and it was because the site isn't in the trusted sites list in the IE options. IE Options -> Security -> Trusted Sites -> Add site to trusted sites.
Mike's user avatar
  • 12.2k
2 votes

Linking from List Item to Multiple Documents in SharePoint Online

Depending on your specific requirements, it sounds you could simply create a lookup column (allow multiple selections) on your employee list. The lookup column source would be your training documents ...
Ornery Walrus's user avatar
2 votes

Several attach field on a form

You can create your own file control in HTML and use below script. //Enable Multiple Upload Script $('.attachmentButton').change(function(event){ //alert("change"); //startUpload(self, function ...
Hardik's user avatar
  • 7,743
2 votes

Handle ListItem attachments via CSOM

Thanks to @Samir Khimani for the help, however the deleting of the attachments does not always work since it modifies the current iteration. I edited a little bit his answer followings: bool update = ...
Emaborsa's user avatar
  • 1,189
2 votes
Accepted

Get attachments hyperlink from a list

You can use the below REST API endpoint: /_api/lists/getByTitle('Test')/items?$select=Title,AttachmentFiles&$expand=AttachmentFiles The full code would be somewhat as below using REST API: $....
Gautam Sheth's user avatar
  • 30.9k
2 votes
Accepted

SP2013 - export custom list attachments with power shell

Refer How to use PowerShell to download attachments Also this Question has some details for the same.
John Zachariah's user avatar
2 votes

How to save image as attachment in List using CSOM C#?

There 2 ways you can add attachments to list items. Option 1 - .AttachmentFiles.Add(attachmentInfo) as below using FileStream: var list = context.Web.Lists.GetByTitle("CustomList"); var listItem = ...
Gautam Sheth's user avatar
  • 30.9k
2 votes
Accepted

How to save image as attachment in List using CSOM C#?

I have used this in PowrShell Scripts May be it will help you foreach($item in $Items) { if($item.Attachments -ne $null) { try { foreach($attachment in $item.Attachments) { ...
Akshay Dattatray Nangare's user avatar
2 votes
Accepted

Sharepoint not saving attachment on EditForm.aspx

There are two issues with you initial code in the line where you call WebForm_DoPostBackWithOptions: WebForm_DoPostBackWithOptions( new WebForm_PostBackOptions( $("[name*='SaveItem']:...
Anon's user avatar
  • 805
2 votes
Accepted

How to allow access to list item file attachments that was not created by the user with special constraints

An alternative approach is to create a people and group column that holds the group name and filter the list view based on that column, instead of item permissions. Create a column of type people and ...
sssreddy's user avatar
  • 4,473
2 votes
Accepted

How can I programatically move an SPListItem from a source list to a destination list (into a specific folder of the list)?

The answer to 1) is "no". You need to copy, then delete. There is no "move". The answer to 2) is "no". You need to attach the attachments manually after you created the item in the destination. ...
Nils's user avatar
  • 2,327
2 votes

How to copy item attachment to another item through Rest api or JSOM?

The following code for your reference. Tested the code. its working <script src="https://code.jquery.com/jquery-1.12.4.min.js" type="text/javascript"></script> <...
LZ_MSFT's user avatar
  • 6,249
2 votes
Accepted

SPO Modern List - How to make the Attachments field mandatory?

Unfortunately, there is no method to make the Attachments column required in Modern Experience. By default, the Attachments column is not available in Column ordering of List Settings, So there is no ...
Lisa Chen MSFT's user avatar
2 votes
Accepted

How to perform column value dependent validation on list attachments

For SharePoint online, you cannot add custom JavaScript to modern list forms. You have to customize the list forms using Power Apps for this requirements. You can achieve this using different ways in ...
Ganesh Sanap - MVP's user avatar
1 vote

Is it possible require an attachment when a specific drop down option is selected?

You can add this code to your NewForm.aspx and EditForm.aspx to check the attachment table rows - this requires an attachment all the time - you can add in the code to only check it whenever a certain ...
Robin in Or's user avatar
  • 2,071
1 vote

How to resolve "The property or field 'ListItemCollectionPosition' has not been initialized.." error?

The Answer above is correct. In case you wonder ,how to do it with more than one Property except "Id": You don't need this if you don't specify which Properties to include in the Load, then all will ...
Markus Doerig's user avatar
1 vote

How to overwrite the attachment for List Item CSOM C#?

You can use the following code to add an item or update it if its already exists. void AddOrUpdateListItemAttachment(ClientContext ctx, ListItem item, string fileName, Stream fileContent) { ...
ThinkB4Code's user avatar
  • 2,970

Only top scored, non community-wiki answers of a minimum length are eligible