Location: PHPKode > projects > Ptk-forensics > ptk/lib/export_sector.php
<?
/*
PTK  - DFLabs
Copyright (C) 2008 - DFLabs srl - All rights reserved
hide@address.com
*/
include("check_session.php");
include("check_session_image.php");
include("lib_commands.php");
include("../config/conf.php");
include("lib_std.php");

$offset = sanitize($_GET['arg1'],INT);
$sector = sanitize($_GET['arg2'],INT);
$total = sanitize($_GET['arg3'],INT);
$name = "Sector$sector.raw";
if (user_can_load_this_image(sanitize($_SESSION['image_id'],INT))){
	$path = sanitize($_SESSION['image_path'],PARANOID);
	export_sector($path, $offset, $sector, $total, $name);
	header('Content-Type: application/octet-stream');
	header("Content-Description: PTK file export");
	header('Content-Length: ' . filesize("$INSTALLDIR/temp/$name"));
	header('Content-Disposition: attachment; filename=' . $name);
	readfile("$INSTALLDIR/temp/$name");
	unlink("$INSTALLDIR/temp/$name");
}else{
        new AuditLog('Unauthorized access to export_sector '.$sector);
        header("location: goto_home.php");
}?>
Return current item: Ptk-forensics