diff --git a/apps/files/appinfo/routes.php b/apps/files/appinfo/routes.php
index 34bb1011773..c5eb86ca91e 100644
--- a/apps/files/appinfo/routes.php
+++ b/apps/files/appinfo/routes.php
@@ -65,6 +65,11 @@ $application->registerRoutes(
'url' => '/',
'verb' => 'GET',
],
+ [
+ 'name' => 'settings#setMaxUploadSize',
+ 'url' => '/settings/maxUpload',
+ 'verb' => 'POST',
+ ]
)
)
);
diff --git a/apps/files/js/admin.js b/apps/files/js/admin.js
index dcfec824cfe..6afd77eb03e 100644
--- a/apps/files/js/admin.js
+++ b/apps/files/js/admin.js
@@ -8,6 +8,46 @@
*
*/
+(function() {
+ if (!OCA.Files) {
+ /**
+ * Namespace for the files app
+ * @namespace OCA.Files
+ */
+ OCA.Files = {};
+ }
+
+ /**
+ * @namespace OCA.Files.Admin
+ */
+ OCA.Files.Admin = {
+ initialize: function() {
+ $('#submitMaxUpload').on('click', _.bind(this._onClickSubmitMaxUpload, this));
+ },
+
+ _onClickSubmitMaxUpload: function () {
+ OC.msg.startSaving('#maxUploadSizeSettingsMsg');
+
+ var request = $.ajax({
+ url: OC.generateUrl('/apps/files/settings/maxUpload'),
+ type: 'POST',
+ data: {
+ maxUploadSize: $('#maxUploadSize').val()
+ }
+ });
+
+ request.done(function (data) {
+ $('#maxUploadSize').val(data.maxUploadSize);
+ OC.msg.finishedSuccess('#maxUploadSizeSettingsMsg', 'Saved');
+ });
+
+ request.fail(function () {
+ OC.msg.finishedError('#maxUploadSizeSettingsMsg', 'Error');
+ });
+ }
+ }
+})();
+
function switchPublicFolder() {
var publicEnable = $('#publicEnable').is(':checked');
// find all radiobuttons of that group
@@ -19,6 +59,8 @@ function switchPublicFolder() {
}
$(document).ready(function() {
+ OCA.Files.Admin.initialize();
+
// Execute the function after loading DOM tree
switchPublicFolder();
$('#publicEnable').click(function() {
diff --git a/apps/files/lib/Controller/SettingsController.php b/apps/files/lib/Controller/SettingsController.php
new file mode 100644
index 00000000000..0b2dc9c2dd1
--- /dev/null
+++ b/apps/files/lib/Controller/SettingsController.php
@@ -0,0 +1,51 @@
+
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see