forked from DmitryVarennikov/cuegenerator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cue.php
32 lines (22 loc) · 780 Bytes
/
cue.php
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
<?php
// NOT USED: see index.php for reference
session_start();
if (array_key_exists('cue', $_SESSION)) {
$filename = $_SESSION['filename']
? pathinfo($_SESSION['filename'], PATHINFO_FILENAME) . '.cue'
: 'untitled.cue';
// tell ugly IE that cach can be done
header('Cache-Control: maxage=3600');
// and it's public
header('Pragma: public');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $filename . '"');
header('Content-Length: ' . $_SESSION['content_length']);
echo trim($_SESSION['cue']);
// so ugly destroy session
$_SESSION = array();
session_destroy();
} else {
header('HTTP/1.0 404 Not Found');
}
exit;