From 58c7042e708172b8e2fe252fc53abe87bcf8c1f1 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 22 Jan 2014 17:17:58 +0100 Subject: Added error message for when target folder was removed Whent trying to upload/rename/create files in a folder that was removed or rename, the correct error message is now shown. In the case of upload of multiple files, the upload is cancelled. This situation can happen if the target folder was renamed or removed from another browser window or client. --- apps/files/js/file-upload.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'apps/files/js') diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index 225c3319107..486273a910c 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -315,6 +315,13 @@ $(document).ready(function() { } else { // HTTP connection problem OC.Notification.show(data.errorThrown); + if (data.result) { + var result = JSON.parse(data.result); + if (result && result[0] && result[0].data && result[0].data.code === 'targetnotfound') { + // abort upload of next files if any + OC.Upload.cancelUploads(); + } + } } //hide notification after 10 sec setTimeout(function() { -- cgit v1.2.3