]> jfr.im git - uguu.git/blame - api.php
Create 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':
7
8 if(!empty($_POST['name'])){
9 save_file($_FILES["file"]["tmp_name"], $_POST['name']);
10 }else{
11 save_file($_FILES["file"]["tmp_name"], $_FILES["file"]["name"]);
12 }
13 break;
14
15 case 'extend-time':
16 break;
17 default:
18 exit('Please provide a valid argument. Example: curl -i -F name=test.jpg -F file=@localfile.jpg http://uguu.se/api.php?d=upload');
19 break;
20 }
21}else{
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}