PluginProbe ʕ •ᴥ•ʔ
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel / 1.2.10
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel v1.2.10
trunk 0.9.0 0.9.1 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.2.0 1.2.1 1.2.10 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 1.4.14 1.4.15 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0
wp-all-export / classes / download.php
wp-all-export / classes Last commit date
CdataStrategy.php 4 years ago CdataStrategyAlways.php 4 years ago CdataStrategyFactory.php 4 years ago CdataStrategyIllegalCharacters.php 4 years ago CdataStrategyIllegalCharactersHtmlEntities.php 4 years ago CdataStrategyNever.php 4 years ago XMLWriter.php 4 years ago chunk.php 4 years ago config.php 4 years ago download.php 4 years ago handler.php 4 years ago helper.php 4 years ago input.php 4 years ago installer.php 4 years ago session.php 4 years ago wpallimport.php 4 years ago zip.php 4 years ago
download.php
58 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 self::sendFile("Content-Type: application/vnd.ms-excel; charset=UTF-8", $file_name);
18 }
19
20 static public function xlsx($file_name)
21 {
22 self::sendFile("Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=UTF-8", $file_name);
23 }
24
25 static public function csv($file_name)
26 {
27 self::sendFile("Content-Type: text/plain; charset=UTF-8", $file_name);
28 }
29
30 static public function txt($file_name)
31 {
32 self::sendFile("Content-Type: text/plain; charset=UTF-8", $file_name);
33 }
34
35 static public function xml($file_name)
36 {
37 self::sendFile("Content-Type: application/xhtml+xml; charset=UTF-8", $file_name);
38 }
39
40 static public function sendFile($header, $file_name)
41 {
42 // If we ar testing don't sent it as attachment
43 if (php_sapi_name() != 'cli-server') {
44 header($header);
45 header("Content-Disposition: attachment; filename=\"" . basename($file_name) . "\"");
46 header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
47 header("Cache-Control: post-check=0, pre-check=0", false);
48 header("Pragma: no-cache");
49 }
50 while (ob_get_level()) {
51 ob_end_clean();
52 }
53
54 readfile($file_name);
55 die;
56 }
57
58 }