After the react project integrates the onlyoffice editor, how can I use an upload file button on the web side to upload the document to the server, and then open it for editing in the editor?

After the react project integrates the onlyoffice editor, how can I use an upload file button on the web side to upload the document to the server, and then open it for editing in the editor?

The key question is: How to upload files to the onlyoffice server in the react project, or how to upload documents in the react project?

就是:怎么样能够在 react项目用了 onlyoffice 的编辑器后,我怎么去通过 upload 去上传文档(不通过桌面端或者文档服务页面,就是在项目中去用代码管控上传文档到 onlyoffice 可以再查看编辑这样)?

Hello,
Document Server is a document editor (ONLYOFFICE Api Documentation - Basic concepts), there is no document management system included with it, so when Document Server is integrated with a React project, you’ll have to build a document management and storage system yourself configuring document opening (ONLYOFFICE Api Documentation - Opening File) and document saving (ONLYOFFICE Api Documentation - Saving File).

你好,
Document Server 是一个文档编辑器(ONLYOFFICE Api Documentation - Basic concepts),它不包含文档管理系统,因此当 Document Server 与 React 项目集成时,您需要自己构建一个 文档管理和存储系统并自行配置文档打开(ONLYOFFICE API 文档 - 打开文件) 和文档保存(ONLYOFFICE API 文档 - 保存文件) , 请查看以下指南以了解该如何实现。

感谢你的回复,还有一些想问一下:
1.“自己构建一个文档管理和存储系统” 是指 需要自己弄个后端接口通过后端数据库存储上传的文件,然后再通过上传后的文档链接去通过文档编辑器打开或者控制保存文件的意思吗?还是指的是部署的documentServerUrl?
因为我想用 react做一个类似这样的界面,但是不知道怎么用 onlyoffice 去实现上传->获取文件列表->编辑其中一个文档的过程

2.另外文档编辑器的document.url可以给不是 onlyoffice 的文档链接吗?比如:http://xxxxxxx/12.pdf这样的

使用的是社区版的

thank you for your reply,and I want to ask some question:

  1. “Build a document management and storage system by yourself” means that you need to create a back-end interface to store the uploaded files through the back-end database, and then use the uploaded document link to open or control the saved file through the document editor. ? Or does it refer to the deployed documentServerUrl?
    Because I want to use react to make an interface similar to this, but I don’t know how to use onlyoffice implement the process of uploading->getting the file list->editing one of the documents.

  2. In addition, can the document.url of the document editor link to documents that are not onlyoffice? For example: http://xxxxxxx/12.pdf

I’m using the community version

  1. 是的,您需要创建一个接口来通过后端数据库存储上传的文件,文档服务器应该能够通过提供的链接从您的存储下载文件并编辑完成后到您存储保存(document url参数 - ONLYOFFICE API 文档 - Config)。
    以下是有关 Document Server - React 应用程序集成的指南:ONLYOFFICE API 文档 - ONLYOFFICE 文档 React 组件

  2. 您应该提供自己网站内文档的链接 (文档存储)