XmlStreamReader
3 weeks ago
partner-discount-sdk
3 weeks ago
api.php
3 weeks ago
arraytoxml.php
3 weeks ago
chunk.php
3 weeks ago
config.php
2 years ago
download.php
3 weeks ago
error.php
3 weeks ago
handler.php
3 weeks ago
helper.php
3 weeks ago
input.php
3 weeks ago
nested.php
3 weeks ago
rapidaddon.php
3 weeks ago
render.php
3 weeks ago
session.php
9 months ago
upload.php
3 weeks ago
zip.php
10 years ago
download.php
39 lines
| 1 | <?php |
| 2 | |
| 3 | class PMXI_Download |
| 4 | { |
| 5 | |
| 6 | static public function zip($file_name) |
| 7 | { |
| 8 | |
| 9 | header('Content-type: application/zip'); |
| 10 | header("Content-Disposition: attachment; filename=\"".basename($file_name)."\""); |
| 11 | readfile($file_name); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_readfile |
| 12 | die; |
| 13 | } |
| 14 | |
| 15 | static public function xls($file_name) |
| 16 | { |
| 17 | header("Content-Type: application/vnd.ms-excel; charset=UTF-8"); |
| 18 | header("Content-Disposition: attachment; filename=\"".basename($file_name)."\""); |
| 19 | readfile($file_name); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_readfile |
| 20 | die; |
| 21 | } |
| 22 | |
| 23 | static public function csv($file_name) |
| 24 | { |
| 25 | header("Content-Type: text/plain; charset=UTF-8"); |
| 26 | header("Content-Disposition: attachment; filename=\"".basename($file_name)."\""); |
| 27 | readfile($file_name); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_readfile |
| 28 | die; |
| 29 | } |
| 30 | |
| 31 | static public function xml($file_name) |
| 32 | { |
| 33 | header("Content-Type: application/xhtml+xml; charset=UTF-8"); |
| 34 | header("Content-Disposition: attachment; filename=\"".basename($file_name)."\""); |
| 35 | readfile($file_name); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_readfile |
| 36 | die; |
| 37 | } |
| 38 | |
| 39 | } |