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

  I found "cook" two days ago. Played around with it for a day and then within a day got rid of two legacy applications in IBM Lotus Domino Notes and replaced them with "cook". It was really easy. A piece of cake. Actually it was even easier than cooking. Cooking involves more work than developing with "cook". What can I say about "cook"? Great application great price for what it delivers great forum with a lot of information and fast responses active and friendly community fast forward moving development cycle So what should I say "Monsieur Le Cook"? Keep the good work going it will lead to success. Having become a paying member in the words of Edith Piaf may I say ..... non rien de rien ... je ne regrette rien. Vive La France.
FK (JED)
         

Get Started