}
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 {
--- /dev/null
+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');