-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDownload.php
More file actions
35 lines (26 loc) · 864 Bytes
/
Copy pathDownload.php
File metadata and controls
35 lines (26 loc) · 864 Bytes
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
try{
require_once './Backend/FetchData.php';
$cid=$_GET['cid'];
$type=$_GET['type'];
if($type=='file'){
list($title,$saved_file,$extension)=processFile($cid);
}else{
list($title,$saved_file)= processNote($cid);
}
if( (! is_null($title) ) && (! is_null($saved_file) ) ){
header('Content-type:text/javascript');
header('Content-Disposition:attachment; filename="'.$title.'"');
if($type=='file'){
readfile('Uploads_7fd8yghg7e6ybn7/Anonymous/Files/'.$saved_file);
}else{
readfile('Uploads_7fd8yghg7e6ybn7/Anonymous/Notes/'.$saved_file);
}
}else{
header("Location: 404.php"); die();
}
}
catch (Exception $e){
header("Location: error.html"); die();
}
?>