Trying to follow this post about halfway down to copy attachments from a list item.
$().SPServices({
operation: "GetItem",
async: false,
Url:srcUrl,
completefunc: function(xData, Status) {
myStream = jQuery(xData.responseXML).find("Stream").text();
console.log(myStream);
}
});
It doesn't produce any error, but xData.responseXML doesn't include any Stream node and the response text includes
<GetItemResult>0</GetItemResult>
Which leads me to believe it isn't finding the source file. My source URL is the url that is given when I check it in the item.
https://site/managedpath/collection/site/Lists/listName/Attachments/itemId/file%20name.pdf
When I paste the url into the browser it shows me the correct file, so I know there is a file there...
Any ideas on how to get the data stream for this document?
EDIT
It does work if I just try and grab a file out of a straight up library. So the problem seems to be with attachments. Where are attachments really stored?
Have you seen the first answer on this question? http://sharepoint.stackexchange.com/questions/62087/how-to-get-a-file-using-sharepoint-client-object-model-with-only-an-absolute-url
– Erin L Nov 17 '15 at 16:34