Server IP : 172.67.157.199 / Your IP : 13.59.203.186 [ Web Server : Apache System : Linux b70eb322-3aee-0c53-7c82-0db91281f2c6.secureserver.net 6.1.90-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 2 12:09:22 EDT 2024 x86_64 User : root ( 0) PHP Version : 8.0.30.2 Disable Function : NONE Domains : 0 Domains MySQL : ON | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/wp-content/plugins/wp-all-export/classes/ |
Upload File : |
<?php class PMXE_Download { static public function zip($file_name) { $uploads = wp_upload_dir(); $bundle_url = $uploads['baseurl'] . str_replace($uploads['basedir'], '', $file_name); $bundle_url = str_replace( "\\", "/", $bundle_url ); wp_redirect($bundle_url); die; } static public function xls($file_name) { self::sendFile("Content-Type: application/vnd.ms-excel; charset=UTF-8", $file_name); } static public function xlsx($file_name) { self::sendFile("Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=UTF-8", $file_name); } static public function csv($file_name) { self::sendFile("Content-Type: text/plain; charset=UTF-8", $file_name); } static public function txt($file_name) { self::sendFile("Content-Type: text/plain; charset=UTF-8", $file_name); } static public function xml($file_name) { self::sendFile("Content-Type: application/xhtml+xml; charset=UTF-8", $file_name); } static public function sendFile($header, $file_name) { // If we ar testing don't sent it as attachment if (php_sapi_name() != 'cli-server') { header($header); header("Content-Disposition: attachment; filename=\"" . basename($file_name) . "\""); header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); } while (ob_get_level()) { ob_end_clean(); } readfile($file_name); die; } }