Mercurial > prosody-modules
comparison 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 |
comparison
equal
deleted
inserted
replaced
4309:e8b9228b5265 | 4310:b0ad1604f77e |
---|---|
126 | 126 |
127 /* Close the streams */ | 127 /* Close the streams */ |
128 fclose($incoming_data); | 128 fclose($incoming_data); |
129 fclose($store_file); | 129 fclose($store_file); |
130 file_put_contents($store_file_name.'-type', $upload_file_type); | 130 file_put_contents($store_file_name.'-type', $upload_file_type); |
131 | |
132 // https://xmpp.org/extensions/xep-0363.html#upload | |
133 // A HTTP status Code of 201 means that the server is now ready to serve the file via the provided GET URL. | |
134 header('HTTP/1.0 201 Created'); | |
135 exit; | |
131 } else if($request_method === 'GET' || $request_method === 'HEAD') { | 136 } else if($request_method === 'GET' || $request_method === 'HEAD') { |
132 // Send file (using X-Sendfile would be nice here...) | 137 // Send file (using X-Sendfile would be nice here...) |
133 if(file_exists($store_file_name)) { | 138 if(file_exists($store_file_name)) { |
134 $mime_type = file_get_contents($store_file_name.'-type'); | 139 $mime_type = file_get_contents($store_file_name.'-type'); |
135 if($mime_type === FALSE) { | 140 if($mime_type === FALSE) { |