Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('checkfiles.php');
- session_start();
- $filename = 'uploads/'.$_SESSION['user_name']. '/'.$_GET['$searchfol'];
- if (file_exists($filename)) {
- echo "The file exists" .$_GET['$searchfol'];;
- } else {
- mkdir('uploads/'.$_SESSION['user_name']. '/'.$_GET['$searchfol'], 0700);
- echo "The folder has been created";
- }
- create new folder
- _____________________________________________________________________________________________________________
- <?php
- include('checkfiles.php');
- session_start();
- $filename = 'uploads/'.$_SESSION['user_name']. '/'.$fileqw;
- $wrongfile= 'uploads/'.$_SESSION['user_name']. '/'.$fileqw. '/';
- if(file_exists($wrongfile))
- {
- echo "Cannot delete folders :Only files";
- }
- else if (file_exists($filename)) {
- unlink('uploads/'.$_SESSION['user_name']. '/'.$fileqw);
- echo "Files has been deleted";
- }
- ?>
- delete files
- _________________________________________________________________________________________________________________
- <?php
- include('checkfiles.php');
- session_start();
- $filename = 'uploads/'.$_SESSION['user_name']. '/'.$fileqw. '/';
- if (file_exists($filename)) {
- rmdir('uploads/'.$_SESSION['user_name']. '/'.$fileqw. '/');
- echo "The folder has been deleted";
- } else {
- echo "Error, This is only for removing folders";
- }
- ?>
- delete folders
- __________________________________________________________________
- download
- <?php
- include('checkfiles.php');
- session_start();
- $file = basename($_GET['file']);
- $file = 'uploads/'.$_SESSION['user_name']. '/'.$fileqw;
- if(!$file){
- die('file not found');
- } else {
- header("Cache-Control: public");
- header("Content-Description: File Transfer");
- header("Content-Disposition: attachment; filename=$file");
- header("Content-Type: application/zip");
- header("Content-Transfer-Encoding: binary");
- // read the file from disk
- readfile($file);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment