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.091 seconds

Hi All just wanted to add one more "thank you" voice to all those who discovered the value of this amazing application. The website I was working on went to production few days ago and I do not want to even try to imagine what would it take to build it without j-cook. So - endless thanks keep it running and evolving I believe it deserves to be the core tool for any joomla application! Thanks!
Michael (bmk028 - Forum)  

Get Started