获取URL以打开基于类型的文件 - Sharepoint 2016 [英] get url to open files based on type - Sharepoint 2016

查看:72
本文介绍了获取URL以打开基于类型的文件 - Sharepoint 2016的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


查看文档库中的文件列表时,会为每个文件分配一个URL,以便在所需的查看器中打开该文件,该文件基于文件类型 


编辑:我正在使用应用程序中的REST API检索文件夹的文件列表,因此我需要了解如何使用API​​提取此信息。


例如,我们现在可以在文档库中打开文本文件,它会加载到特定的查看器中,以便我们编辑文件。 如果我们点击图片,图片会打开以显示图片等。 不同文件组的每个网址(即图片,
文本文件,视频,办公文档等)都有自己的特定网址,可以在相应的查看器中打开它们。


有关此新功能的详细信息,请参阅此网址:


https://techcommunity.microsoft.com/t5/OneDrive-for-Business/Announcing-New-文件查看器 - 适用于OneDrive-For-Business / mp / 60040




有没有办法访问使用javascript为每种文件类型更正网址?




干杯Greg J

解决方案

您好,


可以在文件超链接的单击事件中找到每种文件类型的打开URL,请参阅屏幕截图: / p>


你C使用Jquery获取onclick事件的字符串值然后组合以获得最终的url打开字符串:

 


( "#the的超链接ID")。attr(" onclick")。toString()

谢谢


最好的问候


Hi,

When viewing a list of files in a document library each file is assigned a URL to open that file in the required viewer which is based on the file type. 

EDIT: I am retrieving a list of files for a folder using the REST API in an App so I need to find out how to pull this information using the API.

For instance, we can now open a text file in a document library, it loads in a specific viewer which allows us to edit the file.  If we click on an image, the image opens to show the image etc.  Each url for the different groups of files (ie, images, text files, videos, office documents etc) have their own specific url to open them in the appropriate viewer.

Refer this url for more information about this new feature:

https://techcommunity.microsoft.com/t5/OneDrive-for-Business/Announcing-New-File-Viewers-Available-for-OneDrive-For-Business/m-p/60040


Is there a way to access correct url for each file type using javascript?


Cheers Greg J

解决方案

Hi,

The open url for each file type can be found in the click event of the file hyperlink, see the screen capture:

You can use Jquery to get the string value of onclick event and then combine to get the final url open string:


("#the id of hyperlink").attr("onclick").toString()

Thanks

Best Regards


这篇关于获取URL以打开基于类型的文件 - Sharepoint 2016的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆