Files: fix moving files by DnD

This commit is contained in:
Robin Appelman 2013-01-31 17:56:44 +01:00
parent b471177439
commit 5417e44b2a
2 changed files with 10 additions and 2 deletions

View File

@ -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 {

8
apps/files/js/upload.js Normal file
View File

@ -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');