mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
Merge pull request #266 from ONLYOFFICE/feature/renaming-files
Feature/renaming files
This commit is contained in:
15
web/documentserver-example/nodejs/app.js
Normal file → Executable file
15
web/documentserver-example/nodejs/app.js
Normal file → Executable file
@ -969,6 +969,21 @@ app.get("/editor", function (req, res) { // define a handler for editing docume
|
||||
}
|
||||
});
|
||||
|
||||
app.post("/rename", function (req, res) { //define a handler for renaming file
|
||||
|
||||
var newfilename = req.body.newfilename;
|
||||
var dockey = req.body.dockey;
|
||||
var meta = {title: newfilename};
|
||||
|
||||
var result = function(err, data, ress) {
|
||||
res.writeHead(200, {"Content-Type": "application/json" });
|
||||
res.write(JSON.stringify({ "result": ress }));
|
||||
res.end();
|
||||
};
|
||||
|
||||
documentService.commandRequest("meta", dockey, meta, result);
|
||||
});
|
||||
|
||||
wopiApp.registerRoutes(app);
|
||||
|
||||
// "Not found" error with 404 status
|
||||
|
||||
Reference in New Issue
Block a user