aboutsummaryrefslogtreecommitdiffstats
path: root/php/upload.php
diff options
context:
space:
mode:
authorAlex Vitkov <alexvitkov98@gmail.com>2021-02-12 20:07:10 +0200
committerAlex Vitkov <alexvitkov98@gmail.com>2021-02-12 20:07:10 +0200
commitd66cf65a66b2eac4b9ccaf47dc7c0e9577687b3f (patch)
treea35e5ce475ae029dbed3e8178182caa22ae25d5f /php/upload.php
parenteecdb71a05c4e6ee255e097bf93df37a1efb751f (diff)
parent369de870ef6dbcd67ac9316bf714a6ded892eadc (diff)
downloadfileup-d66cf65a66b2eac4b9ccaf47dc7c0e9577687b3f.tar.gz
Merge branch 'master' of https://github.com/alexvitkov/india
Diffstat (limited to 'php/upload.php')
-rw-r--r--php/upload.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/php/upload.php b/php/upload.php
index b22c3a8..ee5d1ae 100644
--- a/php/upload.php
+++ b/php/upload.php
@@ -1,6 +1,7 @@
<?php
require_once "database.php";
require_once "configuration.php";
+require_once "file_type_recogniser.php";
session_start();
if (!isset( $_POST["filename"]) || !isset($_FILES["the_file"]))
@@ -14,9 +15,10 @@ $file=$_FILES["the_file"];
$filename=$_POST["filename"];
$user=$_SESSION['user_object'];
$homedir=$user->home_directory;
+$mimetype=file_type($file['tmp_name']);
-$codename=$database->create_file_node($filename,"",$homedir,$user);
+$codename=$database->create_file_node($filename,"",$homedir,$mimetype,$user);
if($codename=="error")
{
error_log("could not create file_node in upload.php");