From e54ff9b0a7007361450d688fd30f7b640e1296a2 Mon Sep 17 00:00:00 2001 From: ethanpil Date: Tue, 17 Jan 2017 13:02:58 -0500 Subject: [PATCH] Add option to disable file uploads --- index.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index 93999bf..925d9dd 100644 --- a/index.php +++ b/index.php @@ -7,7 +7,8 @@ Liscense: MIT ********************************/ // Set to false to disable delete button and delete POST request. -$allow_delete = true; +$allow_delete = false; +$allow_upload = true; /* Uncomment section below, if you want a trivial password protection */ @@ -86,7 +87,7 @@ if($_GET['do'] == 'list') { chdir($file); @mkdir($_POST['name']); exit; -} elseif ($_POST['do'] == 'upload') { +} elseif ($_POST['do'] == 'upload' && $allow_upload == true) { var_dump($_POST); var_dump($_FILES); var_dump($_FILES['file_data']['tmp_name']); @@ -260,7 +261,7 @@ $(function(){ $dir.val(''); return false; }); - + // file upload stuff $('#file_drop_target').bind('dragover',function(){ $(this).addClass('drag_over'); @@ -326,7 +327,7 @@ $(function(){ .append( $('').html(' file size - ' + formatFileSize(file.size) + '' +' exceeds max upload size of ' + formatFileSize(MAX_UPLOAD_SIZE) + '') ); } - + function list() { var hashval = window.location.hash.substr(1); $.get('?',{'do':'list','file':hashval},function(data) { @@ -399,11 +400,13 @@ $(function(){ +
Drag Files Here To Upload or
+