diff --git a/lib/file-control-xhr.php b/lib/file-control-xhr.php index 0569ac1..f2bed8d 100644 --- a/lib/file-control-xhr.php +++ b/lib/file-control-xhr.php @@ -390,7 +390,8 @@ if (!$error && $_GET['action']=="move") { if (!ftpRename($ftpConn, $srcDir, $tgtDir)) { $doNext .= 'top.ICEcoder.message("Sorry, could not rename '.$srcDir.' to '.$tgtDir.'");'; } else { - $fileOrFolder = "folder"; + $ftpFileDirInfo = ftpGetFileInfo($ftpConn, ltrim($fileLoc,"/"), $fileName); + $fileOrFolder = $ftpFileDirInfo['type'] == "directory" ? "folder" : "file"; $updateFM = true; } // Local @@ -403,7 +404,7 @@ if (!$error && $_GET['action']=="move") { } // Update file manager on success if ($updateFM) { - $doNext .= 'top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'move\',\''.$fileLoc.'\',\''.$fileName.'\',\'\',\''.str_replace($iceRoot,"",strClean(str_replace("|","/",$_GET['oldFileName']))).'\',false,top.ICEcoder.isFileFolder(\''.strClean($_GET['oldFileName']).'\'));'; + $doNext .= 'top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'move\',\''.$fileLoc.'\',\''.$fileName.'\',\'\',\''.str_replace($iceRoot,"",strClean(str_replace("|","/",$_GET['oldFileName']))).'\',false,$fileOrFolder);'; } $finalAction = "move"; // Run our custom processes @@ -579,31 +580,55 @@ if (!isset($ftpSite) && !$error && $_GET['action']=="upload") { // DELETE FILE(S)/FOLDER(S) // ======================== -if (!isset($ftpSite) && !$error && $_GET['action']=="delete") { +if (!$error && $_GET['action']=="delete") { $filesArray = explode(";",$file); // May contain more than one file here - for ($i=0;$i