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 ...
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);
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 ...
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 ...
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"&...
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%20Framework')/items
?$select=Lookup1/Title,Lookup2/...
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 ...
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 ...
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 ...
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="...
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 ...
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....
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....
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.
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 ...
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 ...
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 = ...
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:
$....
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.
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 = ...
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)
{
...
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']:...
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 ...
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.
...
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>
<...
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 ...
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 ...
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 ...
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 ...
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)
{
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
attachments × 342list × 84
sharepoint-online × 69
2010 × 36
2013 × 34
javascript × 26
infopath × 23
custom-list × 22
email × 21
sharepoint-enterprise × 19
sharepoint-designer × 16
document-library × 15
sharepoint-server × 14
development × 14
file-upload × 14
list-item × 14
rest × 13
workflow × 12
powershell × 10
2007 × 10
flow × 9
outlook × 9
office-365 × 8
jquery × 8
modern-experience × 8