diff mod_http_upload_external/share_v2.php @ 4310:b0ad1604f77e

mod_http_upload_external: update php scripts to return HTTP 201 Created on upload
author Richard Schwab <hgprosodyim-lawrpxz9uw@central-intelligence.agency>
date Mon, 21 Dec 2020 19:29:04 +0100
parents bada43f3a546
children
line wrap: on
line diff
--- a/mod_http_upload_external/share_v2.php	Wed Dec 16 22:07:09 2020 +0100
+++ b/mod_http_upload_external/share_v2.php	Mon Dec 21 19:29:04 2020 +0100
@@ -128,6 +128,11 @@
 	fclose($incoming_data);
 	fclose($store_file);
 	file_put_contents($store_file_name.'-type', $upload_file_type);
+
+	// https://xmpp.org/extensions/xep-0363.html#upload
+	// A HTTP status Code of 201 means that the server is now ready to serve the file via the provided GET URL.
+	header('HTTP/1.0 201 Created');
+	exit;
 } else if($request_method === 'GET' || $request_method === 'HEAD') {
 	// Send file (using X-Sendfile would be nice here...)
 	if(file_exists($store_file_name)) {