Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

How to make files form 1:n collection downloadable 18 Mar 2016 22:37 #13856

  • krasy
  • krasy's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 90
  • Thank you received: 8
hi,
I have some attachments connected to 1 record,
I can display their filenames in the collection and in also in the fly,

Is there a simple way to convert that names to downloadable links
any ides where to start?

thx

Please Log in or Create an account to join the conversation.

How to make files form 1:n collection downloadable 21 Mar 2016 12:37 #13859

You can create links
foreach ($item->attachments as $attachment) {
 echo '<a href="'.$attachment->filename.'">'.$attachment->name.'</a>';
}

Filename should be a full url like: www.yourdomain.com/downloads/file1.pdf
The following user(s) said Thank You: krasy

Please Log in or Create an account to join the conversation.

How to make files form 1:n collection downloadable 22 Mar 2016 19:40 #13860

  • krasy
  • krasy's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 90
  • Thank you received: 8
thx Romkabouter for replay

in collection:
echo JDom::_('html.fly.file', array(
'dataKey' => 'zalacznik',
'dataObject' => $rel,
'height' => 'auto',
'indirect' => true,
'root' => '[DIR_DOKUMENTY_ZALACZNIK]',
'target' => 'download'
));

Please Log in or Create an account to join the conversation.

How to make files form 1:n collection downloadable 22 Mar 2016 20:20 #13861

I do not understand, did you fix your question with this code or is this generated?

Please Log in or Create an account to join the conversation.

How to make files form 1:n collection downloadable 24 Mar 2016 10:15 #13867

  • krasy
  • krasy's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 90
  • Thank you received: 8
Hi I have changed generated code of view in collection,
that was connected to 1:n files

to that I've posted and enabled downloading attachment.
It works, all attachment listed is 1:n collection are downloadable :).
thx

Please Log in or Create an account to join the conversation.

How to make files form 1:n collection downloadable 24 Mar 2016 10:18 #13868

B)

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.095 seconds

For starters it's just so easy to design an app in a way that I'm used to i.e. database first then views followed by customization. The fork system is pure brilliance from a developer standpoint as I can override things and still add and update my projects with minimal effort! Truly amazing to be able to build components in Joomla using incremental refinement without having to do everything by hand. Thanks for the great tool! I am so much more productive now than ever and I can't imagine building components any other way!!!!
Dave (Forum)

Get Started