create a link to retrieve file for download

Permalink 2 users found helpful
Triing to create a url link that can be used to retrieve a file from the file manager

$file = File::getByID($fID); 
$path = $file->getDownloadUrl();
$filename  = $file->getFileName();


creates the url fine but cant download the file.

the link i end up with is:http://www.wizardontherun.com/index.php/download_file/9/dev.dadeser...

any help?

wizardontherun
View Replies: View Best Answer
Remo replied on at Permalink Best Answer Reply
Remo
you don't need the filename at the end..
andrew replied on at Permalink Reply
andrew
Correct. The $path variable you have above should be sufficient. No need to include the filename at all.
wizardontherun replied on at Permalink Reply
wizardontherun
Thanks, but just tring to understand, what does the link, link to? how does this work?
Remo replied on at Permalink Reply
Remo
it's a simple file streaming through a php script which allows you to add more features like password protection to your files..