How to generate download URL in 3rd part extension?

Phoca Download - download manager
2brolab
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 21 Sep 2014, 15:21

How to generate download URL in 3rd part extension?

Post by 2brolab »

Hi there,

I want to have user dashboard with latest uploaded files from other users (from different categories).

I can't find function/method to generate proper file download url based on phocadowlonad configuration.

I mean, I'm looking for smth like: $file->url = PhocaDownload::_Url($file->id) ;

Maybe someone can help me or link me to source where I can find this?


Thanks in advance,
Vitaly
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: How to generate download URL in 3rd part extension?

Post by Jan »

Hi, see the code of category view:

components/com_phocadownload/views/category/view.html.php
components/com_phocadownload/views/category/tmpl/ ...

There you can see which methods are creating the link to download :idea:

Jan
If you find Phoca extensions useful, please support the project
2brolab
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 21 Sep 2014, 15:21

Re: How to generate download URL in 3rd part extension?

Post by 2brolab »

Hi Jan,

thanks for your help.

done. you can close this topic.

maybe would be useful for someone else

Code: Select all

$url = JRoute::_(PhocaDownloadRoute::getFileRoute($file_id, $category_id, $file_alias, $cagory_alias, $section_id, 'download'));

You can close this topic.

Vitaly
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: How to generate download URL in 3rd part extension?

Post by Jan »

Ok, thank you for the info.

Jan
If you find Phoca extensions useful, please support the project
Post Reply