diff options
author | adam <adam@> | 2021-02-12 19:09:42 +0200 |
---|---|---|
committer | adam <adam@> | 2021-02-12 19:09:42 +0200 |
commit | b1689d03b0ac8a601f3ff4a225729d1e15b317ba (patch) | |
tree | 81476c675a5787a071a8a854aebb58293b6496b2 /php/upload.php | |
parent | 705f95545b1f6520ce1fb9c39c6f826484c780bf (diff) | |
download | fileup-b1689d03b0ac8a601f3ff4a225729d1e15b317ba.tar.gz |
almost there
Diffstat (limited to 'php/upload.php')
-rw-r--r-- | php/upload.php | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/php/upload.php b/php/upload.php index b36a0f1..b22c3a8 100644 --- a/php/upload.php +++ b/php/upload.php @@ -3,23 +3,20 @@ require_once "database.php"; require_once "configuration.php"; session_start(); -echo 1; if (!isset( $_POST["filename"]) || !isset($_FILES["the_file"])) { error_log("someone tried to upload something impropperly"); http_response_code(400); exit(1); } -echo 2; $file=$_FILES["the_file"]; $filename=$_POST["filename"]; -$homedir=$_SESSION['user_object']; +$user=$_SESSION['user_object']; +$homedir=$user->home_directory; -echo 3; -$codename=$database->create_file_node($filename,"",$_SESSION['user_object']->home_directory); -echo $codename; +$codename=$database->create_file_node($filename,"",$homedir,$user); if($codename=="error") { error_log("could not create file_node in upload.php"); |