简体   繁体   中英

Php Download file to read from different Folders

I'm using Zubarg Smart File Download , to force my users to download audio files using :

download.php?f=FileName

i want this download.php to read mp3 files from different folders which are defined in :

define('BASE_DIR','downloads/');

how can i add more than one directories above to read from ??

Thanks

this is the code you need.

    header("Content-Description: File Transfer;");
       header('Content-Type: audio/mpeg');
header('Content-Disposition: attachment, filename="' . $temp['file'] . $temp['fileext'].'";');  

header("Content-Length: ".filesize(BASE_DIR.$temp['file']));
readfile(BASE_DIR.$temp['file']);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM