Page 1 of 1

How to generate download URL in 3rd part extension?

Posted: 21 Sep 2014, 15:41
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

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

Posted: 21 Sep 2014, 18:05
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

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

Posted: 21 Sep 2014, 19:15
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

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

Posted: 23 Sep 2014, 00:17
by Jan
Ok, thank you for the info.

Jan