Exemple #1
0
 function get_content_file($file = false)
 {
     return get_content_file($file);
 }
                    send_json($e->getMessage(), null);
                    throw new Exception($e->getMessage());
                }
            } else {
                send_json($name . " can't be writable !!", null);
                throw new Exception($name . " can't be writable !!");
            }
        } else {
            send_json("File " . $name . " not found !!", null);
            throw new Exception("File " . $name . " not found !!");
        }
    }
}
switch ($_POST["action"]) {
    case 'file_get_content':
        get_content_file($_POST['name'], rtrim($_POST['from'], "/") . "/");
        break;
    case 'file_put_content':
        put_content_file($_POST['name'], rtrim($_POST['from'], "/") . "/", $_POST["file_content"]);
        break;
    case 'create_folder':
        create_folder($_POST["name"], rtrim($_POST["to"], '/') . '/');
        break;
    case 'copy':
        copy_file($_POST["file_name"], rtrim($_POST["from"], "/") . "/", rtrim($_POST['to'], "/") . "/");
        break;
    case 'multiple_copy':
        copy_multiple_file($_POST["file"], $_POST["folder"], $_POST["folder_name"], rtrim($_POST["from"], "/") . "/", rtrim($_POST['to'], "/") . "/");
        break;
    case 'rename':
        rename_file($_POST["old_name"], $_POST["new_name"], rtrim($_POST["to"], "/") . '/');