]> source.dussan.org Git - nextcloud-server.git/commitdiff
finally the missing file for moving files from the web interface
authorRobin Appelman <icewind1991@gmail.com>
Fri, 22 Jul 2011 04:21:53 +0000 (06:21 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Fri, 22 Jul 2011 04:21:53 +0000 (06:21 +0200)
files/ajax/move.php [new file with mode: 0644]

diff --git a/files/ajax/move.php b/files/ajax/move.php
new file mode 100644 (file)
index 0000000..b1ba641
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+
+// Init owncloud
+require_once('../../lib/base.php');
+
+// We send json data
+header( "Content-Type: application/jsonrequest" );
+
+// Check if we are a user
+if( !OC_USER::isLoggedIn()){
+       echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
+       exit();
+}
+
+// Get data
+$dir = $_GET["dir"];
+$file = $_GET["file"];
+$target = $_GET["target"];
+
+
+if(OC_FILES::move($dir,$file,$target,$file)){
+       echo json_encode( array( "status" => 'success', "data" => array( "dir" => $dir, "files" => $file )));
+}else{
+       echo json_encode( array( "status" => 'error', "data" => array( "message" => "Could move $file" )));
+}
+
+?>
\ No newline at end of file