summaryrefslogtreecommitdiffstats
path: root/files/ajax/rename.php
blob: 87ffbc3ada0784ee9a88819bb173e1ffa8f5dda8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php

// Init owncloud
require_once('../../lib/base.php');

OC_JSON::checkLoggedIn();

// Get data
$dir = $_GET["dir"];
$file = $_GET["file"];
$newname = $_GET["newname"];

// Delete
if( OC_Files::move( $dir, $file, $dir, $newname )) {
	OC_JSON::success(array("data" => array( "dir" => $dir, "file" => $file, "newname" => $newname )));
}
else{
	OC_JSON::error(array("data" => array( "message" => "Unable to rename file" )));
}

?>