diff options
author | adam <adam@> | 2021-02-12 13:24:33 +0200 |
---|---|---|
committer | adam <adam@> | 2021-02-12 13:24:33 +0200 |
commit | 077cab20146bf7cb26c330465fbd56cc0e0ddada (patch) | |
tree | cf686f7f1829b4da77f32cb5031fec16504efca4 /php/database.php | |
parent | 527301b44e44e994c89ba4db47a49e37eaef4d1b (diff) | |
download | fileup-077cab20146bf7cb26c330465fbd56cc0e0ddada.tar.gz |
asdf
Diffstat (limited to 'php/database.php')
-rw-r--r-- | php/database.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/php/database.php b/php/database.php index cfef823..b1e0419 100644 --- a/php/database.php +++ b/php/database.php @@ -168,22 +168,22 @@ require_once "node.php"; function create_file_node(string $filename): string { global $storage_root; - $code=get_random_node_name(""); - if($filename==NULL)return false; + $code=$this->get_random_node_name(""); + if($filename==NULL)return "error"; $prep=$this->pdo->prepare("insert into nodes(is_directory,relative_path,name,code) values(false,:root,:name,:code) "); $prep->bindParam(':name',$filename); $prep->bindParam(':root',$storage_root); - $prep->bindParam(':code',$code); + if($prep->execute()==false) { error_log("could not upload file"); /*not so quiet error*/ return "error"; } - return code; + return $code; } function are_linked(int $directory_id,int $node_id): bool { |