home_directory; $mimetype=file_type($file['tmp_name']); $codename=$database->create_file_node($filename,"",$homedir,$mimetype,$user); if($codename=="error") { error_log("could not create file_node in upload.php"); http_response_code(400); exit(0); } if($codename=="filename taken") { http_response_code(409); exit(0); } move_uploaded_file($file['tmp_name'], "$storage_root/$codename"); http_response_code(200); exit(0); ?>