comparison mod_http_upload_external/share_v2.php @ 3164:5176b8d81ec7

share_v2.php: Remove content-disposition if mime type is set
author Matthew Wild <mwild1@gmail.com>
date Mon, 02 Jul 2018 12:56:19 +0100
parents 31b85864a615
children 3b13f19652e2
comparison
equal deleted inserted replaced
3163:31b85864a615 3164:5176b8d81ec7
126 // Send file (using X-Sendfile would be nice here...) 126 // Send file (using X-Sendfile would be nice here...)
127 if(file_exists($store_file_name)) { 127 if(file_exists($store_file_name)) {
128 $mime_type = file_get_contents($store_file_name.'-type'); 128 $mime_type = file_get_contents($store_file_name.'-type');
129 if($mime_type === FALSE) { 129 if($mime_type === FALSE) {
130 $mime_type = 'application/octet-stream'; 130 $mime_type = 'application/octet-stream';
131 header('Content-Disposition: attachment');
131 } 132 }
132 header('Content-Disposition: attachment');
133 header('Content-Type: '.$mime_type); 133 header('Content-Type: '.$mime_type);
134 header('Content-Length: '.filesize($store_file_name)); 134 header('Content-Length: '.filesize($store_file_name));
135 header("Content-Security-Policy: \"default-src 'none'\""); 135 header("Content-Security-Policy: \"default-src 'none'\"");
136 header("X-Content-Security-Policy: \"default-src 'none'\""); 136 header("X-Content-Security-Policy: \"default-src 'none'\"");
137 header("X-WebKit-CSP: \"default-src 'none'\""); 137 header("X-WebKit-CSP: \"default-src 'none'\"");