From af0c31ec0ebbfabd3f6140b816752ccf96313225 Mon Sep 17 00:00:00 2001 From: adam Date: Fri, 12 Feb 2021 19:54:52 +0200 Subject: mimetype draft --- php/database.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'php/database.php') diff --git a/php/database.php b/php/database.php index fb3d35d..f5efec7 100644 --- a/php/database.php +++ b/php/database.php @@ -306,7 +306,7 @@ require_once "node.php"; } } /*returns the file name as it must be in the filesystem relative to the storage root*/ - function create_file_node(string $filename,string $note,int $dir_id,User $user): string + function create_file_node(string $filename,string $note,int $dir_id,string $mimetype,User $user): string { global $storage_root; /*checkout the directory*/ -- cgit v1.2.3 From 369de870ef6dbcd67ac9316bf714a6ded892eadc Mon Sep 17 00:00:00 2001 From: adam Date: Fri, 12 Feb 2021 20:03:00 +0200 Subject: guesses mime types now --- php/database.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'php/database.php') diff --git a/php/database.php b/php/database.php index f5efec7..789ea86 100644 --- a/php/database.php +++ b/php/database.php @@ -347,11 +347,12 @@ require_once "node.php"; /*generate the node*/ $code=$this->get_random_node_name(""); if($filename==NULL)return "error"; - $prep=$this->pdo->prepare("insert into nodes(is_directory,relative_path,code) - values(false,:root,:code) + $prep=$this->pdo->prepare("insert into nodes(is_directory,relative_path,code,type) + values(false,:root,:code,:type) "); $prep->bindParam(':root',$code); $prep->bindParam(':code',$code); + $prep->bindParam(':type',$mimetype); if($prep->execute()==false) { -- cgit v1.2.3