fixing some bugs in uploader

This commit is contained in:
2025-03-30 10:34:53 +01:00
parent 2fb6ab6254
commit ddb49d44de
4 changed files with 114 additions and 41 deletions

View File

@@ -6,5 +6,9 @@
}
$username=$_SESSION["username"];
$path = "/var/www/html/user_files/$username/";
$_SESSION["current_file"]=$path.$_GET["file"];
$public_path = "/var/www/html/user_files/public/";
if($_GET["pc"]=="1")
$_SESSION["current_file"]=$public_path.$_GET["file"];
else
$_SESSION["current_file"]=$path.$_GET["file"];
?>

View File

@@ -7,8 +7,10 @@ session_start();
exit;
}
$username=$_SESSION["username"];
echo(get_base64_preview("/var/www/html/user_files/$username/".$_GET["file"]));
if($_GET["pc"]=="1")
echo(get_base64_preview("/var/www/html/user_files/public/".$_GET["file"]));
else
echo(get_base64_preview("/var/www/html/user_files/$username/".$_GET["file"]));
function get_base64_preview($filename){
$base64="";
$file=fopen($filename,"r");