diff --git a/docs/www/fileupload.php b/docs/www/fileupload.php index 0c7aaf6..ad2f2f5 100644 --- a/docs/www/fileupload.php +++ b/docs/www/fileupload.php @@ -20,7 +20,8 @@ if(isset($_POST["submit"])) { $firstDir = bin2hex(random_bytes(16)); $secondDir = bin2hex(random_bytes(16)); $filename = bin2hex(random_bytes(16)); - $combinedPath = $firstDir."/".$secondDir."/".$filename; + $extension = pathinfo($_FILES['userfile']['name'], PATHINFO_EXTENSION);; + $combinedPath = $firstDir."/".$secondDir."/".$filename.".".$extension; mkdir($uploadDir.$firstDir, 0774); mkdir($uploadDir.$firstDir."/".$secondDir, 0774);