From e628921a338684a4bc3f196c5c39beba8b8f9b68 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Tue, 7 Feb 2017 16:26:17 +0100 Subject: Add rename functionality This also break backwardscompat since PUT is now POST and PUT is used for renaming --- cli/actions.js | 2 +- frontend/index.html | 35 +++++++++++++++++++++++++++++++---- frontend/js/app.js | 40 ++++++++++++++++++++++++++++++++++++---- server.js | 3 ++- src/files.js | 33 +++++++++++++++++++++++++++++---- 5 files changed, 99 insertions(+), 14 deletions(-) diff --git a/cli/actions.js b/cli/actions.js index 69ffa10..ea2a3a1 100644 --- a/cli/actions.js +++ b/cli/actions.js @@ -118,7 +118,7 @@ function put(filePath, otherFilePaths, options) { var destinationPath = (destination ? '/' + destination : '') + '/' + relativeFilePath; console.log('Uploading file %s -> %s', relativeFilePath.cyan, destinationPath.cyan); - superagent.put(config.server() + API + destinationPath).query(gQuery).attach('file', file).end(function (error, result) { + superagent.post(config.server() + API + destinationPath).query(gQuery).attach('file', file).end(function (error, result) { if (result && result.statusCode === 403) return callback(new Error('Upload destination ' + destinationPath + ' not allowed')); if (result && result.statusCode !== 201) return callback(new Error('Error uploading file: ' + result.statusCode)); if (error) return callback(error); diff --git a/frontend/index.html b/frontend/index.html index e9775e8..cbbd85e 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -41,7 +41,7 @@ + +