From 5417e44b2a6d03042156e002264525091f66a6ad Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 31 Jan 2013 17:56:44 +0100 Subject: [PATCH] Files: fix moving files by DnD --- apps/files/ajax/move.php | 4 ++-- apps/files/js/upload.js | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 apps/files/js/upload.js diff --git a/apps/files/ajax/move.php b/apps/files/ajax/move.php index 99e43ed23be..78ed218c136 100644 --- a/apps/files/ajax/move.php +++ b/apps/files/ajax/move.php @@ -17,8 +17,8 @@ if(\OC\Files\Filesystem::file_exists($target . '/' . $file)) { } if ($dir != '' || $file != 'Shared') { - $targetFile = \OC\Files\Filesystem::normalizePath($dir . '/' . $file); - $sourceFile = \OC\Files\Filesystem::normalizePath($target . '/' . $file); + $targetFile = \OC\Files\Filesystem::normalizePath($target . '/' . $file); + $sourceFile = \OC\Files\Filesystem::normalizePath($dir . '/' . $file); if(\OC\Files\Filesystem::rename($sourceFile, $targetFile)) { OCP\JSON::success(array("data" => array( "dir" => $dir, "files" => $file ))); } else { diff --git a/apps/files/js/upload.js b/apps/files/js/upload.js new file mode 100644 index 00000000000..9d9f61f600e --- /dev/null +++ b/apps/files/js/upload.js @@ -0,0 +1,8 @@ +function Upload(fileSelector) { + if ($.support.xhrFileUpload) { + return new XHRUpload(fileSelector.target.files); + } else { + return new FormUpload(fileSelector); + } +} +Upload.target = OC.filePath('files', 'ajax', 'upload.php'); -- 2.39.5