uguu/api.php

28 lines
553 B
PHP
Raw Normal View History

2015-02-04 20:21:50 +01:00
<?php
if(isset($_GET['d'])) {
include_once('core.php');
switch ($_GET['d']) {
case 'upload':
2015-02-07 19:19:38 +01:00
$name = $_FILES['file']['name'];
2015-02-07 19:20:34 +01:00
2015-02-07 19:19:38 +01:00
if(!empty($_POST['name'])){
2015-02-07 19:20:34 +01:00
$name = $_POST['name'];}
2015-02-07 19:28:24 +01:00
if(!empty($_POST['autoext'])){
//
}
2015-02-07 19:19:38 +01:00
save_file($_FILES['file']['tmp_name'], $name);
break;
2015-02-04 20:21:50 +01:00
case 'extend-time':
break;
default:
exit('Please provide a valid argument. Example: curl -i -F name=test.jpg -F file=@localfile.jpg http://uguu.se/api.php?d=upload');
break;
}
}else{
2015-02-07 19:28:24 +01:00
header('Location: http://uguu.se');
2015-02-04 20:21:50 +01:00
}