text changes to registration mail content
[namibia] / public / scripts / blueimp-jQuery-File-Upload / server / php / index.php
1 <?php
2 /*
3  * jQuery File Upload Plugin PHP Example 5.7
4  * https://github.com/blueimp/jQuery-File-Upload
5  *
6  * Copyright 2010, Sebastian Tschan
7  * https://blueimp.net
8  *
9  * Licensed under the MIT license:
10  * http://www.opensource.org/licenses/MIT
11  */
12
13 error_reporting(E_ALL | E_STRICT);
14
15 require('upload.class.php');
16
17 $upload_handler = new UploadHandler();
18
19 header('Pragma: no-cache');
20 header('Cache-Control: no-store, no-cache, must-revalidate');
21 header('Content-Disposition: inline; filename="files.json"');
22 header('X-Content-Type-Options: nosniff');
23 header('Access-Control-Allow-Origin: *');
24 header('Access-Control-Allow-Methods: OPTIONS, HEAD, GET, POST, PUT, DELETE');
25 header('Access-Control-Allow-Headers: X-File-Name, X-File-Type, X-File-Size');
26
27 switch ($_SERVER['REQUEST_METHOD']) {
28     case 'OPTIONS':
29         break;
30     case 'HEAD':
31     case 'GET':
32         $upload_handler->get();
33         break;
34     case 'POST':
35         if (isset($_REQUEST['_method']) && $_REQUEST['_method'] === 'DELETE') {
36             $upload_handler->delete();
37         } else {
38             $upload_handler->post();
39         }
40         break;
41     case 'DELETE':
42         $upload_handler->delete();
43         break;
44     default:
45         header('HTTP/1.1 405 Method Not Allowed');
46 }