HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/PvdBoogaard/indoorski.nl/backup/oude-site/cms/admin/downloadimage.php
<?php

define('IN_CONTROL_PANEL', true);

require_once(dirname(dirname(__FILE__)) . '/api/iwp.php');

$iwp = IWP::Init('basic,functions', true);

$imagename = str_replace("\\", "/", $_GET['image']);
$imagename = $iwp->valid->FilterFilenameOnly($imagename);
$imagepath = IWP_IMAGES_PATH .'/'. $imagename;
if (!file_exists($imagepath)) {
	die();
}

while (@ob_end_clean()) { }

$filesize = filesize($imagepath);
$showname = basename($imagepath);

header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
header("Content-Disposition: attachment; filename=\"". $showname ."\";");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ". $filesize);

$handle = fopen($imagepath, 'rb');
while (!feof($handle)) {
	$buffer = fread($handle, 32768);
	echo $buffer;
}

fclose($handle);
die();