From: Johannes Zellner Date: Tue, 7 Feb 2017 15:26:17 +0000 (+0100) Subject: Add rename functionality X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FProjets%2FNodejs%2FSurfer.git;a=commitdiff_plain;h=e628921a338684a4bc3f196c5c39beba8b8f9b68 Add rename functionality This also break backwardscompat since PUT is now POST and PUT is used for renaming --- 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 @@ + +