How can I add attachments to my component?

97 views
Skip to first unread message

Marc Casas Soler

unread,
Apr 16, 2014, 7:41:44 AM4/16/14
to joomla-de...@googlegroups.com
Hi,

I'm a novice Joomla developer working in a couple of components, and I need to attach documents (pdf and doc) in one of them, and images to the other.

I've already built a backend to the components, without the attachments part and I've already defined the tables to store the attachments and so.

And my problem is that I don't know how to start. If I'm not wrong, the behavior must be:
- If the component is in create mode, don't show anything about attachments
- If the component is in edit mode, show the currently attached documents and an input field of type "file" and an "attach file" button.
- When a file is uploaded, I must add it to my attachments table (only information data) and move the file to the uploads directory.

So, if I'm not wrong, I know how all the procedure must work, but I don't have a clue about how to implement this. Do you know any tutorial or documentation about this?

Thank you a lot!

Allon Moritz

unread,
Apr 16, 2014, 2:59:40 PM4/16/14
to joomla-de...@googlegroups.com
Why do you want to make it by your own? Something like that exists already https://joomla.digital-peak.com/products/dpattachments. Code can be found here https://github.com/Digital-Peak/DPAttachments and it will take you only three lines of code to implement it into your component. It support copy paste support for images as well.

Yes I'm the developer of it :-)



--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com.
To post to this group, send an email to joomla-de...@googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/d/optout.

Marc Casas Soler

unread,
Apr 17, 2014, 3:35:20 AM4/17/14
to joomla-de...@googlegroups.com
Hi Iaoneo,

Your DPAttachments seem interesting, but I don't understand how to integrate it with my component... :/

How can I add it to my component's backend? Where can I find any example about how it work? I've been looking at your github repository, but I don't understant how to use it...

Thank you!
Reply all
Reply to author
Forward
0 new messages