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

  Excellent Tool ! This tool will save you a lot of time writing the same old structure. I've used others but this is really nice for a quick start. Makes a 3 hour task a 15 minute one. Thanks for this extension
dickrundell (JED)
         

Get Started