-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariables.php
More file actions
37 lines (32 loc) · 1.2 KB
/
variables.php
File metadata and controls
37 lines (32 loc) · 1.2 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
36
37
<?php
/**
* Single use download variables
* Defines where the actual download location is
* Defines the path to the download file (download.php)
* Sets a fake files name to show to users (should not be the same name as the real file)
* Sets the admin password to generate a new download link
* Sets a date when the file will expire (examples: +1 year, +5 days, +13 hours)
*/
// Arrays of content type, suggested names and protected names
$PROTECTED_DOWNLOADS = array(
array(
'content_type' => 'application/zip',
'suggested_name' => 'computing.zip',
'protected_path' => 'secret/file1.zip'
),
array(
'content_type' => 'application/zip',
'suggested_name' => 'star.zip',
'protected_path' => 'secret/file2.zip'
)
);
// The path to the download.php file (probably same dir as this file)
define('DOWNLOAD_PATH','/singleuse/download.php');
// The admin password to generate a new download link
define('ADMIN_PASSWORD','1234');
// The expiration date of the link (examples: +1 year, +5 days, +13 hours)
define('EXPIRATION_DATE', '+1 month');
// Don't worry about this
header("Cache-Control: no-cache, must-revalidate");
header("Expires: ".date('U', strtotime(EXPIRATION_DATE)));
?>