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:

any help?

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