1

I'm trying to get the file size of attachments using SharePoint designer. I have the correct url but when calling the web service i get the count of items returned = 0 .

The url i use is :

https://tenant.sharepoint.com/_api/web/getfilebyserverrelativeurl('/Lists/RALLILessons/Attachments/28170/test.pdf')

Here is a screenshot of the steps used :

enter image description here

Anyone knows what i'm doing wrong. On previous steps i use this rest api call :

https://tennant.sharepoint.com/_api/web/lists/getbytitle('RALLI-Lessons')/Items(24452)/attachmentfiles

to get the Server Relative Url which i then use to construct the rest api call for the file properties.

Any ideas what i'm doing wrong? Should i use the d/results ?

2

Firstly, get the attach file ServerRelativeUrl with the Rest EndPoint below:

https://kevindemo167.sharepoint.com/sites/Developer/_api/web/lists/getbyTitle('TestList')/items(1)?$expand=AttachmentFiles enter image description here

Then access the file and properties with this Url:

https://kevindemo167.sharepoint.com/sites/Developer/_api/web/getfilebyserverrelativeurl('/sites/Developer/Lists/TestList/Attachments/1/Untitled.png')

Note, the serveraltiveurl should be the same as the url got from first EndPoint, and there is a properties named "Length", it's the attachment file length/size: enter image description here

In the workflow, Please use "d/Length" to get the file length from the response Dictionary: enter image description here

  • Much appreciated it for the reply. I actually found out the solution using Postman . I could see that there is no results nodes , and i use d/length. However thanks again . I will mark your post as the answer – shak Nov 2 '17 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.