diff options
Diffstat (limited to 'httpserver/resources/local')
-rw-r--r-- | httpserver/resources/local/.htpasswd | 1 | ||||
-rw-r--r-- | httpserver/resources/local/upload.php | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/httpserver/resources/local/.htpasswd b/httpserver/resources/local/.htpasswd new file mode 100644 index 0000000..e991d18 --- /dev/null +++ b/httpserver/resources/local/.htpasswd @@ -0,0 +1 @@ +demo:$apr1$UhwaUkTW$lTHMzOU2TyNn6qM8P/zS3. diff --git a/httpserver/resources/local/upload.php b/httpserver/resources/local/upload.php new file mode 100644 index 0000000..31dbaa3 --- /dev/null +++ b/httpserver/resources/local/upload.php @@ -0,0 +1,18 @@ +<?PHP + if(!empty($_FILES['uploaded_file'])) + { + $dirpath = ""; + $path = $dirpath . basename( $_FILES['uploaded_file']['name']); + $filename = $_FILES['uploaded_file']['name']; + $filepath = '/usr/local/apache2/htdocs/'.$path; + + if (file_exists($filepath)) { + echo "The file $filename exists" .PHP_EOL; + } else if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $path)) { + echo "The file ". basename( $_FILES['uploaded_file']['name']). + " has been uploaded" .PHP_EOL; + } else{ + echo "There was an error uploading the file, please try again!" .PHP_EOL; + } + } +?> |