From c4d24c0a4c38f77a821c6556c7d1ef48944a2afa Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Mon, 12 Nov 2012 09:26:50 +0000 Subject: [PATCH] Pasting a new file Looks to see if the location is writable and if so, copy our file to that location Then adds the new file to the file manager, otherwise, informs you it couldn't do it Clears server message eitherway --- lib/file-control.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/file-control.php b/lib/file-control.php index 8a9046d..4ca64ef 100644 --- a/lib/file-control.php +++ b/lib/file-control.php @@ -52,6 +52,19 @@ if ($_GET['action']=="newFolder") { echo ''; } +// If we're due to paste a new file... +if ($_GET['action']=="paste") { + $location = $docRoot.strClean(str_replace("|","/",$_GET['location'])); + if (is_writable($location)) { + copy($file, $location."/".basename($file)); + // Reload file manager + echo ''; + } else { + echo ""; + } + echo ''; +} + // If we're due to rename a file/folder... if ($_GET['action']=="rename") { if (is_writable($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])))) {