CdataStrategy.php
8 years ago
CdataStrategyAlways.php
8 years ago
CdataStrategyFactory.php
8 years ago
CdataStrategyIllegalCharacters.php
8 years ago
CdataStrategyIllegalCharactersHtmlEntities.php
8 years ago
CdataStrategyNever.php
8 years ago
XMLWriter.php
8 years ago
chunk.php
8 years ago
config.php
8 years ago
download.php
8 years ago
handler.php
8 years ago
helper.php
8 years ago
input.php
8 years ago
installer.php
8 years ago
session.php
8 years ago
wpallimport.php
8 years ago
zip.php
8 years ago
download.php
47 lines
| 1 | <?php |
| 2 | |
| 3 | class PMXE_Download |
| 4 | { |
| 5 | |
| 6 | static public function zip($file_name) |
| 7 | { |
| 8 | $uploads = wp_upload_dir(); |
| 9 | $bundle_url = $uploads['baseurl'] . str_replace($uploads['basedir'], '', $file_name); |
| 10 | $bundle_url = str_replace( "\\", "/", $bundle_url ); |
| 11 | wp_redirect($bundle_url); |
| 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); |
| 20 | die; |
| 21 | } |
| 22 | |
| 23 | static public function xlsx($file_name) |
| 24 | { |
| 25 | header("Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=UTF-8"); |
| 26 | header("Content-Disposition: attachment; filename=\"".basename($file_name)."\""); |
| 27 | readfile($file_name); |
| 28 | die; |
| 29 | } |
| 30 | |
| 31 | static public function csv($file_name) |
| 32 | { |
| 33 | header("Content-Type: text/plain; charset=UTF-8"); |
| 34 | header("Content-Disposition: attachment; filename=\"".basename($file_name)."\""); |
| 35 | readfile($file_name); |
| 36 | die; |
| 37 | } |
| 38 | |
| 39 | static public function xml($file_name) |
| 40 | { |
| 41 | header("Content-Type: application/xhtml+xml; charset=UTF-8"); |
| 42 | header("Content-Disposition: attachment; filename=\"".basename($file_name)."\""); |
| 43 | readfile($file_name); |
| 44 | die; |
| 45 | } |
| 46 | |
| 47 | } |