'; echo ''; echo $file; echo ''; echo ''; echo 'Download'; echo 'Delete'; echo ''; echo ''; } } closedir($handle); } } } // download file if (isset($_GET['path'])) { //Read the url $url = $_GET['path']; //Clear the cache clearstatcache(); //Check the file path exists or not if (file_exists($url)) { //Define header information header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="'.basename($url).'"'); header('Content-Length: '.filesize($url)); header('Pragma: public'); //Clear system output buffer flush(); //Read the size of the file readfile($url, true); //Terminate from the script exit(); } else { // do nothing } } // do nothing if (isset($_GET['delete'], $_GET['file'])) { $delfile = $_GET['file']; /* header("Location: $delfile"); */ if (unlink($delfile)) { // file was successfully deleted header('Refresh:0 url=files.php?success_msg=1'); } else { // there was a problem deleting the file header('Refresh:0 url=files.php?error_msg=1'); } } ?>

Files

File Actions