aboutsummaryrefslogtreecommitdiff
path: root/mod/lightpics/vendors/jquery-file-upload/server/php/index.php
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-12-29 20:45:58 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-12-29 20:45:58 -0200
commit97e689213ff4e829f251af526ed4e796a3cc2b71 (patch)
treeb04d03ec56305041216b72328fc9b5afde27bc76 /mod/lightpics/vendors/jquery-file-upload/server/php/index.php
parent0ab6351abb7a602d96c62b0ad35413c88113a6cf (diff)
parent69e2d8c5d8732042c9319aef1fdea45a82b63e42 (diff)
downloadelgg-97e689213ff4e829f251af526ed4e796a3cc2b71.tar.gz
elgg-97e689213ff4e829f251af526ed4e796a3cc2b71.tar.bz2
Merge branch 'master' into saravea
Conflicts: .gitmodules mod/admins mod/assemblies mod/audio_html5 mod/beechat mod/crud mod/elgg-activitystreams mod/elggman mod/elggpg mod/favorites mod/federated-objects mod/friendly_time mod/group_alias mod/group_operators mod/languages mod/lightpics mod/openid_client mod/spotlight mod/suicide mod/tasks mod/videolist
Diffstat (limited to 'mod/lightpics/vendors/jquery-file-upload/server/php/index.php')
-rw-r--r--mod/lightpics/vendors/jquery-file-upload/server/php/index.php46
1 files changed, 46 insertions, 0 deletions
diff --git a/mod/lightpics/vendors/jquery-file-upload/server/php/index.php b/mod/lightpics/vendors/jquery-file-upload/server/php/index.php
new file mode 100644
index 000000000..1601c76f3
--- /dev/null
+++ b/mod/lightpics/vendors/jquery-file-upload/server/php/index.php
@@ -0,0 +1,46 @@
+<?php
+/*
+ * jQuery File Upload Plugin PHP Example 5.7
+ * https://github.com/blueimp/jQuery-File-Upload
+ *
+ * Copyright 2010, Sebastian Tschan
+ * https://blueimp.net
+ *
+ * Licensed under the MIT license:
+ * http://www.opensource.org/licenses/MIT
+ */
+
+error_reporting(E_ALL | E_STRICT);
+
+require('upload.class.php');
+
+$upload_handler = new UploadHandler();
+
+header('Pragma: no-cache');
+header('Cache-Control: no-store, no-cache, must-revalidate');
+header('Content-Disposition: inline; filename="files.json"');
+header('X-Content-Type-Options: nosniff');
+header('Access-Control-Allow-Origin: *');
+header('Access-Control-Allow-Methods: OPTIONS, HEAD, GET, POST, PUT, DELETE');
+header('Access-Control-Allow-Headers: X-File-Name, X-File-Type, X-File-Size');
+
+switch ($_SERVER['REQUEST_METHOD']) {
+ case 'OPTIONS':
+ break;
+ case 'HEAD':
+ case 'GET':
+ $upload_handler->get();
+ break;
+ case 'POST':
+ if (isset($_REQUEST['_method']) && $_REQUEST['_method'] === 'DELETE') {
+ $upload_handler->delete();
+ } else {
+ $upload_handler->post();
+ }
+ break;
+ case 'DELETE':
+ $upload_handler->delete();
+ break;
+ default:
+ header('HTTP/1.1 405 Method Not Allowed');
+}