X-Git-Url: https://jfr.im/git/uguu.git/blobdiff_plain/362ed96d0d5d123ff78c89d7fab138b688912364..43599d9a39258d9df81ad1f451ace4afdd71ded3:/api.php diff --git a/api.php b/api.php index 3c24e7f..8b2a78d 100644 --- a/api.php +++ b/api.php @@ -2,16 +2,21 @@ //If the value d doesn't exist, redirect back to front page *1 if(isset($_GET['d'])) { //Include the core file with the functions - include_once('core.php'); + include_once('includes/core.php'); switch ($_GET['d']) { case 'upload': //Set the name value to the original filename $name = $_FILES['file']['name']; + $arg = 'custom_original'; //If the value name contains a custom name, set the name value if(!empty($_POST['name'])){ $name = $_POST['name'];} + //If value contains anything, keep original filename + if(!empty($_POST['randomname'])){ + $name = $_FILES['file']['name']; + $arg = 'random';} //Call the save function which sends the file+name - save_file($_FILES['file']['tmp_name'], $name); + save_file($_FILES['file']['tmp_name'], $name, $arg); break; case 'extend-time': break; @@ -22,5 +27,5 @@ if(isset($_GET['d'])) { } }else{ //*1 - header('Location: index.html); + header('Location: index.html'); }