<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
        <!-- Optional theme -->
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
    </head>

    <h2>Uploaded Files</h2>
    <a href="index.php">Upload Files</a>
    <br />
    <br />
    <?php 
$util = new Util();
$errors = array();
if ($util->isPostRequest()) {
    $filename = filter_input(INPUT_POST, 'filename');
    try {
        $deleteFile = new Delete_file();
        $deleteFile->deleteFile($filename);
        $message = 'File deleted successfully';
    } catch (Exception $ex) {
        $errors[] = $ex->getMessage();
    }
}
$directory = scandir('./uploads');
//var_dump($directory);
?>
    <table class="table"><thead><td>Filename</td>
        <td>File Type</td><td>File Size</td><td>Delete</td></thead>
    <?php 
foreach ($directory as $file) {
    ?>
        <?php 
Exemplo n.º 2
0
        <meta charset="UTF-8">
        <title>View</title>
        <!-- Latest compiled and minified CSS -->
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
        <!-- Optional theme -->
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
    </head>
    <body>
        
        <?php 
$util = new Util();
if ($util->isPostRequest()) {
    $folder = './pic_upload/';
    $delete_file = filter_input(INPUT_POST, 'delete_file');
    try {
        $filename = new Delete_file();
        $filename->f_Delete($delete_file);
    } catch (RuntimeException $e) {
    }
}
//DirSep
$folder = './pic_upload/';
$directory = scandir('./pic_upload/');
//var_dump($directory);
?>
 
         
        <table class="table "><thead><td>File Name </td> <td> File Size </td><td> File Type </td><td> Delete </td> </thead>
        <?php 
foreach ($directory as $file) {
    ?>