简体   繁体   English

从SharePoint外部的另一个应用程序上载在线SharePoint网站集文档库中的文档

[英]Upload document in online SharePoint site collection document library from another application outside SharePoint

  1. I have developed a SharePoint App that is running on Online SharePoint 2016 site Collection. 我已经开发了在Online SharePoint 2016网站集中运行的SharePoint应用程序。

  2. Have another Software Application with Rest API that is running on my another Online server. 在另一个在线服务器上运行另一个带有Rest API的软件应用程序。 More this app is purely developed using HTML,Javascript/JQuery. 更多此应用程序是完全使用HTML,Javascript / JQuery开发的。 no server side scripting. 没有服务器端脚本。

  3. More SharePoint App strongly integrated with my Software Application (using Ajax calls for data fetching). 更多SharePoint应用程序与我的软件应用程序紧密集成(使用Ajax调用进行数据提取)。

Now the issue is, i want to upload files into SharePoint from Software Application. 现在的问题是,我想从软件应用程序将文件上传到SharePoint。

Note: Anonymous access is not available in Office 365 Online account as per my R&D. 注意:根据我的研发,匿名访问在Office 365 Online帐户中不可用。

Please help and Thanks in Advance. 请帮助并提前致谢。

You can follow the steps below to upload a file by using the REST API and jQuery: 您可以按照以下步骤使用REST API和jQuery上传文件:

  1. Convert the local file to an array buffer by using the FileReader API, which requires HTML5 support. 通过使用需要HTML5支持的FileReader API,将本地文件转换为数组缓冲区。 The jQuery(document).ready function check FileReader API support in the browser. jQuery(document).ready函数在浏览器中检查FileReader API支持。
  2. Add the file to the Shared Documents folder by using the Add method on the folder's file collection. 通过使用文件夹的文件集合上的Add方法将文件添加到Shared Documents文件夹。 The array buffer is passed in the body of the POST request. 数组缓冲区在POST请求的主体中传递。
  3. Get the list item that correspond to uploaded file by using the ListItemAllFields property of uploaded file. 通过使用上载文件的ListItemAllFields属性获取与上载文件相对应的列表项。
  4. Change the display name and title of the list item by using a MERGE request. 通过使用MERGE请求更改列表项的显示名称和标题。

These examples use the getfolderbyserverrelativeurl endpoint to reach the file collection. 这些示例使用getfolderbyserverrelativeurl端点到达文件集合。 You can also use a list endpoint (example: …/_api/web/lists/getbytitle('')/rootfolder/files/add). 您还可以使用列表端点(例如:…/ _api / web / lists / getbytitle('')/ rootfolder / files / add)。

For more information, please review the following link: Upload a file by using the REST API and jQuery 有关更多信息,请查看以下链接: 使用REST API和jQuery上传文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从外部处理SharePoint 2013 Online App宿主网站的文档 - Process Document from SharePoint 2013 Online App Host Site Externally 使用来自外部MVC应用程序的jquery将文档上载到sharepoint 2010库 - Upload Document to a sharepoint 2010 library using jquery from external MVC application REST上载到SharePoint 2013联机文档库后获取项ID - Getting Item ID after REST Upload to SharePoint 2013 Online Document Library Sharepoint:将程序复制文件复制到另一个文档库 - Sharepoint: Programmatic Copy File to Another Document library 如何在Angular 4应用程序中将文件上传到SharePoint Online库? - How to upload a file to SharePoint Online library in Angular 4 application? 使用CSOM / JavaScript的SharePoint 2013 HTML5 Javascript上传到文档库 - SharePoint 2013 HTML5 Javascript Upload to Document library with CSOM/JavaScript 如何从 Sharepoint 文档库文件夹中检索文件 - How to retrieve files from Sharepoint Document library Folders 更改共享库中的“添加新文档”链接 - Change the “add new document” link in sharepoint library 如何找到SharePoint文档库的最后修改? - how to find last modified of sharepoint document library? Sharepoint文档库-使用javascript的标题文件名 - Sharepoint Document Library - Filename to title using javascript
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM