-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequest_file.php
More file actions
35 lines (33 loc) · 1.06 KB
/
request_file.php
File metadata and controls
35 lines (33 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
$URL_REF = (string)$_SERVER['HTTP_REFERER'];
$temp = explode('/', $URL_REF);
$referring_page = end($temp);
if($referring_page=="mainpage.php")
{
/*$random = rand(0,15);
$rand_string = md5($rand_string);
$file_to_download = "temp/".$rand_string.
if(copy($_GET['url'],$file_to_download))
{*/
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="'.$_GET['file_name'].'"');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($_GET['url']));
ob_clean();
flush();
readfile($_GET['url']);
/*}
else
{
header ("Location: "."index.php?unabletocopy")
}*/
}
else
{
header ("Location: "."index.php");
}
?>