×
Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues
Field File ?
Eric Fagault
New Member
Posts: 18
6 года 7 мес. назад #1778
от Eric Fagault
Eric Fagault создал тему: Field File ?
Hello,
I need to create a field "file" but I do not see the field of type "filemultiple" in the list of choice of fields.
It is very important that the field allows the upload of only one file.
So, I changed the type of field "Filemultiple" in field of type "File" in the XML file but when I do that, the image is not saved in the table.
How can I get a "File" field instead of "Filemultiple"?
Best regards.
Eric
I need to create a field "file" but I do not see the field of type "filemultiple" in the list of choice of fields.
It is very important that the field allows the upload of only one file.
So, I changed the type of field "Filemultiple" in field of type "File" in the XML file but when I do that, the image is not saved in the table.
How can I get a "File" field instead of "Filemultiple"?
Best regards.
Eric
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
David Vargas
New Member
Posts: 17
6 года 7 мес. назад #1790
от David Vargas
David Vargas ответил в теме Field File ?
Hi, Eric!
Filemultiple is not part of the standard Joomla form field types. File is the only one that allows the upload of files. See all the information about this field type here .
It appears that there is not any formal restriction about the number of files that can be uploaded from the Joomla side, but looking at Mozilla Developer Network page about the HTML input field that Joomla is actually building, it indicates that there can be set a restriction by removing multiple from element's attributes.
Please, do that and check if it works.
Kind regards,
David.
Filemultiple is not part of the standard Joomla form field types. File is the only one that allows the upload of files. See all the information about this field type here .
It appears that there is not any formal restriction about the number of files that can be uploaded from the Joomla side, but looking at Mozilla Developer Network page about the HTML input field that Joomla is actually building, it indicates that there can be set a restriction by removing multiple from element's attributes.
Please, do that and check if it works.
Kind regards,
David.
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
Eric Fagault
New Member
Posts: 18
6 года 7 мес. назад #1791
от Eric Fagault
Eric Fagault ответил в теме Field File ?
Good evening,
Thank you for your reply.
Although I have watched carefully Joomla documentation but what I need is a type "File" and have a type "Filemultiple", and I do not see how to do so that "Filemultiple" (which n 'does not exist in the Joomla schamps list), so how to make "Filemultiple" behave like "File", since the utilsatuer can only load one file.
How do you think?
Best regard.
Eric
Thank you for your reply.
Although I have watched carefully Joomla documentation but what I need is a type "File" and have a type "Filemultiple", and I do not see how to do so that "Filemultiple" (which n 'does not exist in the Joomla schamps list), so how to make "Filemultiple" behave like "File", since the utilsatuer can only load one file.
How do you think?
Best regard.
Eric
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
David Vargas
New Member
Posts: 17
6 года 6 мес. назад #1792
от David Vargas
David Vargas ответил в теме Field File ?
Hi, Eric!
As I told you, a restriction can be set in the Front-end, no matter what type is the field in Joomla. Look for the view of the component in the code of your web page and remove the attribute "multiple" in the input tag that corresponds to the upload button. That should fix your issue.
See examples in the MDN web docs for this element .
Kind regards,
David.
As I told you, a restriction can be set in the Front-end, no matter what type is the field in Joomla. Look for the view of the component in the code of your web page and remove the attribute "multiple" in the input tag that corresponds to the upload button. That should fix your issue.
See examples in the MDN web docs for this element .
Kind regards,
David.
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
Eric Fagault
New Member
Posts: 18
6 года 6 мес. назад - 6 года 6 мес. назад #1794
от Eric Fagault
Eric Fagault ответил в теме Field File ?
Hello,
Thank you for your reply.
I respond late to your message.
I do not locate where I can remove the "multiple" attribute as specified in the documentation: "developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file"
Here is what I have in the file:
I do not locate where I can remove the "multiple" attribute as specified in the documentation: "developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file"
Best regards.
Eric
Thank you for your reply.
I respond late to your message.
I do not locate where I can remove the "multiple" attribute as specified in the documentation: "developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file"
Here is what I have in the file:
<? php echo $ this-> form-> renderField ('photoprincipal'); ?>
<? php if (! empty ($ this-> item-> photoprincipal)):?>
<? php $ photoprincipaleFiles = array (); ?>
<? php foreach ((array) $ this-> item-> photoprincipal as $ fileSingle):?>
<? php if (! is_array ($ fileSingle)):?>
<a href="<?php echo JRoute::_(JUri::root().'uploads'. DIRECTORY_SEPARATOR. $fileSingle, false);?> "> <? php echo $ fileSingle; ?> </a> |
<? php $ photoprincipaleFiles [] = $ fileSingle; ?>
<? php endif; ?>
<? php endforeach; ?>
<? php endif; ?>
<input type = "hidden" name = "jform [photoprincipale_hidden]" id = "jform_photoprincipale_hidden" value = "<? php echo implode (',', $ photoprincipaleFiles);?>" />
</ Div>
I do not locate where I can remove the "multiple" attribute as specified in the documentation: "developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file"
Best regards.
Eric
Последнее редактирование: 6 года 6 мес. назад пользователем Eric Fagault.
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
David Vargas
New Member
Posts: 17
6 года 5 мес. назад #1801
от David Vargas
David Vargas ответил в теме Field File ?
Hi Eric,
I have been reviewing the generation of these fields from CC and indeed, it is a Component Creator issue. It always generates the file forms multiple.
While this issue is solved, it can be manually corrected editing your component's code. I suggest you to open the component folder after downloading it with a text editor like VS Code. Then, make a global search of 'multiple'. You will find some files that are responsible of generating these fields. They will have the multiple attribute by default. It may be possible to solve it by removing directly this attribute and its other appearances in the code. Then, zip the component again and reinstall the component in Joomla.
Regards,
David.
I have been reviewing the generation of these fields from CC and indeed, it is a Component Creator issue. It always generates the file forms multiple.
While this issue is solved, it can be manually corrected editing your component's code. I suggest you to open the component folder after downloading it with a text editor like VS Code. Then, make a global search of 'multiple'. You will find some files that are responsible of generating these fields. They will have the multiple attribute by default. It may be possible to solve it by removing directly this attribute and its other appearances in the code. Then, zip the component again and reinstall the component in Joomla.
Regards,
David.
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
Время создания страницы: 0.059 секунд