Merge pull request #266 from ONLYOFFICE/feature/renaming-files

Feature/renaming files
This commit is contained in:
Sergey Linnik
2022-03-18 10:31:19 +03:00
committed by GitHub
28 changed files with 476 additions and 64 deletions

15
web/documentserver-example/nodejs/app.js Normal file → Executable file
View 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