本文介绍了使用SharePoint Designer获取附件的大小(长度)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!

Hi everyone!

我正在尝试使用SharePoint Designer获得附件的文件大小.我在浏览器上测试了正确的URL,但是通过SharePoint Designer调用Web服务并调用命令d/results时,我得到的返回计数为0.

I'm trying to get the file size of attachments using SharePoint designer. I have the correct url tested on my browser but when calling the web service through SharePoint designer and calling command d/results  i get the count of items returned = 0 .

我使用的网址是:

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

这是使用步骤的屏幕截图:

Here is a screenshot of the steps used :

谁都知道我在做什么错.在前面的步骤中,我使用此rest api调用:

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

获取服务器相对网址,然后使用该网址构造文件属性的其余api调用.

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

任何想法我在做什么错?我应该使用d/结果吗?

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

推荐答案

https://sharepoint.stackexchange.com/questions/126561/get-the-attachement-files-from-rest-api

https://sharepoint.stackexchange.com/questions/126561/get-the-attachement-files-from-rest-api

_api/lists/getByTitle('MyList')/items?



然后,您可以使用附件文件属性 列表项中的一个,它将是AttachmentFile对象的数组.

Then you can get attachment info (if it exists) in the AttachmentFiles property of your list item which will be an array of AttachmentFile objects.

我建议您只检查开发工具中的返回值,以类似以下方式检查结构:

I suggest you just check out the return values in your dev tools to inspect the structure with something like:


这篇关于使用SharePoint Designer获取附件的大小(长度)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 00:25