doNotUseXsendFile)) { //_error_log("X-Sendfile: {$path}"); header("X-Sendfile: {$path}"); } else { _error_log("Careful, we recommend you to use the X-Sendfile and it is disabled on AdvancedCustom plugin -> doNotUseXsendFile. You may have an error 'Allowed Memory Size Exhausted' if your video file is too big", AVideoLog::$WARNING); } } else { $advancedCustom->doNotUseXsendFile = true; } header("Content-type: " . mime_content_type($path)); header('Content-Length: ' . filesize($path)); if (!empty($advancedCustom->doNotUseXsendFile)) { ini_set('memory_limit', filesize($path) * 1.5); _error_log("Your XSEND File is not enabled, it may slow down your site, file = $path", AVideoLog::$WARNING); //echo url_get_contents($path); // stream the file $fp = fopen($path, 'rb'); fpassthru($fp); } die(); } else { _error_log("XSENDFILE ERROR: Not exists {$path}"); }