diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php
index 38e3858cd3846..4be5c0a0b63bf 100644
--- a/apps/files/lib/Controller/ViewController.php
+++ b/apps/files/lib/Controller/ViewController.php
@@ -280,7 +280,8 @@ public function index($dir = '', $view = '', $fileid = null, $fileNotFound = fal
$this->initialState->provideInitialState('templates', $this->templateManager->listCreators());
$params = [
- 'fileNotFound' => $fileNotFound ? 1 : 0
+ 'fileNotFound' => $fileNotFound ? 1 : 0,
+ 'disableEditLocally' => $this->config->getSystemValueString('disable_edit_locally', 0),
];
$response = new TemplateResponse(
diff --git a/apps/files/src/actions/editLocallyAction.ts b/apps/files/src/actions/editLocallyAction.ts
index f52f8191df87e..57593b8c72d72 100644
--- a/apps/files/src/actions/editLocallyAction.ts
+++ b/apps/files/src/actions/editLocallyAction.ts
@@ -51,6 +51,10 @@ export const action = new FileAction({
// Only works on single files
enabled(nodes: Node[]) {
+ if ($('#disableEditLocally').val() === "1") {
+ return false
+ }
+
// Only works on single node
if (nodes.length !== 1) {
return false
diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php
index c974a37aa5bcd..4694d025993f0 100644
--- a/apps/files/templates/index.php
+++ b/apps/files/templates/index.php
@@ -7,3 +7,4 @@
+