]> jfr.im git - uguu.git/blame - api.php
Update api.php
[uguu.git] / api.php
CommitLineData
78b2d83e
GJ
1<?php
2if(isset($_GET['d'])) {
3 include_once('core.php');
4 switch ($_GET['d']) {
5
6 case 'upload':
f6de5bc0 7 $name = $_FILES['file']['name'];
ff3c1102 8
f6de5bc0 9 if(!empty($_POST['name'])){
ff3c1102
GJ
10 $name = $_POST['name'];}
11
3ce12dae
GJ
12 if(!empty($_POST['autoext'])){
13 //
14 }
15
f6de5bc0
GJ
16 save_file($_FILES['file']['tmp_name'], $name);
17 break;
78b2d83e
GJ
18
19 case 'extend-time':
20 break;
21 default:
22 exit('Please provide a valid argument. Example: curl -i -F name=test.jpg -F file=@localfile.jpg http://uguu.se/api.php?d=upload');
23 break;
24 }
25}else{
3ce12dae 26 header('Location: http://uguu.se');
78b2d83e 27}