1

i am using the technique to add custom fields to articles described here: https://docs.joomla.org/Adding_custom_fields_to_core_components_using_a_plugin

Everything is working well, except for file-uploads. My first guess was to use the media-field type to let the user upload pdf files, but it only supports image files, so, i thought about using the file-field type. But it does not upload anything, just returns the filename. I checked and saw, that the form is missing enctype="multipart/form-data", so i took a look at: administrator/components/com_content/views/article/tmpl/edit.php and noticed that the form-tag is hard-coded, no possibility to add the enctype:

<form action="<?php echo JRoute::_('index.php?option=com_content&layout=' . $layout . $tmpl . '&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="item-form" class="form-validate">

My question: Is there any possibility to let the user upload pdf or doc files in a single article without core-hacks?

Thanks in advance!

1

Solved it this way:

Installed the newest JCE-Release and used a media-field instead of a file-field. JCE replaces the media field with its own filepicker, wich is limited to images only. In the form-field xml i've added:

filter=""

That did the trick, now i am able to select pdf files with a Joomla media field in a content-plugin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.