From f94e6036980644bdd6312e75a8973f2633cf5ff2 Mon Sep 17 00:00:00 2001 From: Jörn Friedrich Dreyer Date: Fri, 16 Aug 2013 11:40:55 +0200 Subject: progress fixes --- apps/files/ajax/upload.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'apps/files/ajax') diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php index 8d183bd1f9c..619b5f6a04b 100644 --- a/apps/files/ajax/upload.php +++ b/apps/files/ajax/upload.php @@ -99,8 +99,8 @@ if (strpos($dir, '..') === false) { $fileCount = count($files['name']); for ($i = 0; $i < $fileCount; $i++) { // $path needs to be normalized - this failed within drag'n'drop upload to a sub-folder - if (isset($_POST['new_name'])) { - $newName = $_POST['new_name']; + if (isset($_POST['newname'])) { + $newName = $_POST['newname']; } else { $newName = $files['name'][$i]; } @@ -109,11 +109,12 @@ if (strpos($dir, '..') === false) { } else { $replace = false; } - $target = \OC\Files\Filesystem::normalizePath(stripslashes($dir).$newName); + $target = \OC\Files\Filesystem::normalizePath(stripslashes($dir).'/'.$newName); if ( ! $replace && \OC\Files\Filesystem::file_exists($target)) { $meta = \OC\Files\Filesystem::getFileInfo($target); $result[] = array('status' => 'existserror', - 'mime' => $meta['mimetype'], + 'type' => $meta['mimetype'], + 'mtime' => $meta['mtime'], 'size' => $meta['size'], 'id' => $meta['fileid'], 'name' => basename($target), -- cgit v1.2.3