aboutsummaryrefslogtreecommitdiffstats
path: root/php/upload.php
blob: 42a8bf6dac99827e0df43e3d5b7d760891997409 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php 
require_once "database.php";
require_once "configuration.php";

if (!isset( $_POST["filename"]) || !isset($_POST["the_file"]))
{
	http_response_code(400);
	error_log("someone tried to upload something impropperly");
	exit(1);
}

$file = $_POST["the_file"];
$filename= $_POST["filename"];


$codename=create_file_node($filename);

copy($file['tmp_name'], "$storage_root/$codename");

echo $codename;
?>