Hi,
We are moving the list item attachment from one list to another list using SharePoint hosted app however we could not able to download the attachment with content using rest api. We are using the below approach to get the attachment.
var filterQuery = appweburl + "/_api/SP.AppContextSite(@target)/web/lists/getByTitle('crosslist')/items?$select=AttachmentFiles,Title&$expand=AttachmentFiles&@target='" + hostweburl + "'";
var jsonObject = JSON.parse(data.body);var results = jsonObject.d.results;
$.each(results, function (index, items) {
FileName = items["AttachmentFiles"].results[0].FileName;
serverrelativeurl = items["AttachmentFiles"].results[0].ServerRelativeUrl;
});
Please let me know the solution