WP Query search for attachments and their exact title

Due to lack of reputation, I must now ask the question. I want to create a search for all images in the media libary. The search result should only appear if you search for the exact title of the image. I already tried it with ‘exact’ => true but it does not work. Still get similar images displayed. I have created a query with the following parameters:

<?php $  args = array(         'post_type' => 'attachment',         'post_mime_type' => 'image',         'orderby' => 'post_date',         'order' => 'desc',         'posts_per_page' => '30',         'post_status'    => 'inherit',          );       $  loop = new WP_Query( $  args );  while ( $  loop->have_posts() ) : $  loop->the_post();  $  image = wp_get_attachment_image_src( get_the_ID() ); echo "<img src='" . $  image[0] . "'>";  endwhile; ?> 

Hope that somebody can help me.

Literature Attachments on Pivotal 5.9

Literature Attachments on Pivotal 5.9

We need to extract all Literature Attachments from the database . We cannot find any tool to assist with this effort . Please describe how we can extract the attachments .

Version – SQL 2008 R2 as database .

Literature attachements could be found either under RM_attachment or attachment_table .

The attachment are stored in the DB as blobs datatype and we need help bulk extracting from database .

Our request is for assistance with extracting those documents without having to open each one and doing as Save as manually recording .

OData Query Options for SPO List Attachments

I am using SSIS with an OData source to pull SharePoint Online 2013 List data into a SQL table. I’d like to filter on the Attachments boolean but can not figure out how to query it.

I saw that an Attachments property exists when I export the Attachment xml information from /_api/Web/Lists/getbytitle('<List>')/items?$ expand=AttachmentFiles. I see the following:

        <m:properties>             <d:FileSystemObjectType m:type="Edm.Int32">0</d:FileSystemObjectType>             <d:Id m:type="Edm.Int32">143</d:Id>             <d:ServerRedirectedEmbedUrl/>             <d:ContentTypeId>0x010029B7BBCFD15FFC439AC3ED59CAD79F26</d:ContentTypeId>             <d:Title m:null="true"/>             <d:OData__x0031_0BDays_Email_Date m:null="true"/>             <d:OData__x0032_0BDays_Email_Date m:null="true"/>             <d:OData__x0033_BDays_Email_Date m:null="true"/>             <d:Covenant_Owner_Name m:null="true"/>             <d:Covenant_Owner_Id m:null="true"/>             <d:Frequency_Narration m:null="true"/>             <d:Business_OwnerId m:type="Edm.Int32">1</d:Business_OwnerId>             <d:Executive_OwnerId m:type="Edm.Int32">37</d:Executive_OwnerId>             <d:AuthorId m:type="Edm.Int32">491</d:AuthorId>             <d:EditorId m:type="Edm.Int32">248</d:EditorId>             <d:Modified m:type="Edm.DateTime">2016-05-10T13:24:58Z</d:Modified>             <d:Created m:type="Edm.DateTime">2016-05-04T13:40:05Z</d:Created>             <d:Flexible m:null="true"/>             <d:ID m:type="Edm.Int32">143</d:ID>             <d:OData__UIVersionString>2.0</d:OData__UIVersionString>             <d:Attachments m:type="Edm.Boolean">true</d:Attachments>             <d:GUID m:type="Edm.Guid">6e808ac8-b836-49b0-8343-9ae627b661d0</d:GUID>         </m:properties> 

I assume since I can query on an OData source with query options like $ filter and $ select that I could filter for: $ filter = Attachments eq true as a query option since many of the other parameters do work, like Id, AuthorId, etc.

enter image description here

The error I receive is pretty vague: The remote server returned an error: (400) Bad Request. and the following when I expand it:

The remote server returned an error: (400) Bad Request. (System)  ------------------------------ Program Location:     at System.Net.HttpWebRequest.GetResponse()    at Microsoft.SqlServer.IntegrationServices.DataFeedClient.Http.HttpWebRequestWrapper.GetResponse()    at Microsoft.SqlServer.IntegrationServices.DataFeedClient.Http.WebRequestHelper.GetResponseWithThreadSafeRetry(IWebRequest& request, Func`1 createWebRequest, Int32 retryCount, Int32 retrySleepInMilliseconds, Boolean isOAuth, Func`2 refreshRequestWithNewAccessToken, Func`2 getStatusCode)    at Microsoft.SqlServer.IntegrationServices.DataFeedClient.Http.WebRequestHelper.GetResponseWithThreadSafeRetryAndImpersonation(IWebRequest& request, DataFeedConnection connection, Func`1 createWebRequest)    at Microsoft.SqlServer.IntegrationServices.DataFeedClient.DataFeedCommand.ExecuteDbDataReader(CommandBehavior behavior)    at System.Data.Common.DbCommand.ExecuteReader()    at Microsoft.DataTransformationServices.DataFlowUI.ODataConnectionPage.PreviewButton_Click(Object sender, EventArgs e) 

Any guidance would be appreciated.

Archive or move List Items with Version History and Attachments using PowerShell

I have a large list that I need to archive list items off to a different list within the same site. (I’ll make the list into a template to make the archive lists.) The list is an InfoPath list that has attachments and has version history enabled. Can PowerShell move the list items from the main list to the other and keep the attachments and version history? I’m also still quite new to PowerShell so I wanted to get some insight from others who have more experience with this sort of thing.

Also I’m using SharePoint 2013 On Prem.

  1. I simply want to know if this is even possible.

  2. I’ve started my script and was able to get my list and filter the content I want to move, I just am unsure how to tackle moving the items and keeping the version history and attachments for the list items that are moved.

Here is what I have so far:

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue Function global:Get-SPWeb($  url)  {   $  site= New-Object Microsoft.SharePoint.SPSite($  url)         if($  site -ne $  null)             {                $  web=$  site.OpenWeb();                      }     return $  web }  #Get the web and List  $  Web = Get-SPWeb "https://ExampleSite.com/SiteOne"  $  SourceList = $  web.Lists["List 1"]  $  TargetList = $  Web.Lists["List 2"]   #Get all items Created before target date    $  Query = New-Object Microsoft.SharePoint.SPQuery $  Query.Query = "@ <Where>     <Eq>         <FieldRef Name='Status' />         <Value Type='Choice'>Complete</Value>     </Eq> </Where>"  #Get List Items matching the query  $  ListItems = $  SourceList.GetItems($  Query)  Write-host "Total Number of Items: "$  ListItems.count 

Archive or move List Items with Version History and Attachments using PowerShell

I have a large list that I need to archive list items off to a different list within the same site. (I’ll make the list into a template to make the archive lists.) The list is an InfoPath list that has attachments and has version history enabled. Can PowerShell move the list items from the main list to the other and keep the attachments and version history? I’m also still quite new to PowerShell so I wanted to get some insight from others who have more experience with this sort of thing.

Also I’m using SharePoint 2013 On Prem.

  1. I simply want to know if this is even possible.

  2. I’ve started my script and was able to get my list and filter the content I want to move, I just am unsure how to tackle moving the items and keeping the version history and attachments for the list items that are moved.

Here is what I have so far:

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue Function global:Get-SPWeb($  url)  {   $  site= New-Object Microsoft.SharePoint.SPSite($  url)         if($  site -ne $  null)             {                $  web=$  site.OpenWeb();                      }     return $  web }  #Get the web and List  $  Web = Get-SPWeb "https://ExampleSite.com/SiteOne"  $  SourceList = $  web.Lists["List 1"]  $  TargetList = $  Web.Lists["List 2"]   #Get all items Created before target date    $  Query = New-Object Microsoft.SharePoint.SPQuery $  Query.Query = "@ <Where>     <Eq>         <FieldRef Name='Status' />         <Value Type='Choice'>Complete</Value>     </Eq> </Where>"  #Get List Items matching the query  $  ListItems = $  SourceList.GetItems($  Query)  Write-host "Total Number of Items: "$  ListItems.count 

Multiple attachments in single email in Flow

I have a html table where the data source is from sharepoint Image library.When a user selects the checkbox the row gets selected and i want to send an email to the user with the selected row value along with image attachment. Here a user can select multiple rows so it has to send multiple attachments in email.

For this approach i have created a flow which runs on item created and modified .

When ever use selects an item from HTML table i am inserting the data in to another list with Item ID of the selected checkboxes with comma seprated values.

Here is My flow screen shot. I was able to send single email with single attachments .How can i send multiple attachments in single email if user has selected 2 items

enter image description hereenter image description hereenter image description here

Sending Emails with Attachments

We have a requirement to have automation of sending emails with Attachments. For example the ff. scenario:

  1. User requests for a document which user does not have access.
  2. Then some approvals happen and once approved
  3. Once approved, workflow will send the document as an attachment to the user

I don’t think out of the box SharePoint Designer workflow can do this.

My current thinking is we can use Custom Visual Studio workflow to download the document and then send an email as attachments using custom code. However, I am concerned with large files or large number of files. Is there a memory limitation or it might slow down the performance of our server if the workflow email attachment constantly runs?

Or are there any better approaches to this one?

409 conflict error when deleting multiple attachments using PnP js or REST

I am trying to delete multiple attachments from list item as below

private _deleteOneByOneAttachment(ln: string, id: any, file: any):Promise<any>{     let item = sp.web.lists.getByTitle(ln).items.getById(id);     return item.attachmentFiles.getByName(file).delete().then(v => {         return v;     }) as Promise<any>;   } 

I am calling above function in promise.all

    b.Files.forEach(k=>{              delArray.push(this._deleteOneByOneAttachment(this.state.appsUsedByStateList,b.ID,k));                     });  Promise.all(delArray) 

if there 4 attachments to delete then 2 are getting deleted and remaining it is giving conflict error, 409.

What is the right way to delete attachments from list item