aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/ajax/upload.php
diff options
context:
space:
mode:
authorMorris Jobke <morris.jobke@gmail.com>2014-01-29 07:48:50 -0800
committerMorris Jobke <morris.jobke@gmail.com>2014-01-29 07:48:50 -0800
commitafa00318bcabf53bed4f33633dae55c9efa43dd7 (patch)
treed3a51668032d86f310288bd7f3280d13f3f63380 /apps/files/ajax/upload.php
parentf5f918b8bf5279fd174fe520c21f83c902904843 (diff)
parent58c7042e708172b8e2fe252fc53abe87bcf8c1f1 (diff)
downloadnextcloud-server-afa00318bcabf53bed4f33633dae55c9efa43dd7.tar.gz
nextcloud-server-afa00318bcabf53bed4f33633dae55c9efa43dd7.zip
Merge pull request #6900 from owncloud/files-errormessagewhentargetfoldermissing
Added error message for when target folder was removed
Diffstat (limited to 'apps/files/ajax/upload.php')
-rw-r--r--apps/files/ajax/upload.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php
index bdaf6a77d14..8f6c42d6620 100644
--- a/apps/files/ajax/upload.php
+++ b/apps/files/ajax/upload.php
@@ -8,6 +8,7 @@ OCP\JSON::setContentTypeHeader('text/plain');
// If no token is sent along, rely on login only
$allowedPermissions = OCP\PERMISSION_ALL;
+$errorCode = null;
$l = OC_L10N::get('files');
if (empty($_POST['dirToken'])) {
@@ -125,7 +126,8 @@ if (strpos($dir, '..') === false) {
$meta = \OC\Files\Filesystem::getFileInfo($target);
if ($meta === false) {
- $error = $l->t('Upload failed. Could not get file info.');
+ $error = $l->t('The target folder has been moved or deleted.');
+ $errorCode = 'targetnotfound';
} else {
$result[] = array('status' => 'success',
'mime' => $meta['mimetype'],
@@ -177,5 +179,5 @@ if ($error === false) {
OCP\JSON::encodedPrint($result);
exit();
} else {
- OCP\JSON::error(array(array('data' => array_merge(array('message' => $error), $storageStats))));
+ OCP\JSON::error(array(array('data' => array_merge(array('message' => $error, 'code' => $errorCode), $storageStats))));
}