×
Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues
"File field" field type not working as expected
Rob LeVine
Nieuw lid
Posts: 7
10 jaren 5 maanden geleden #89
door Rob LeVine
"File field" field type not working as expected werd gestart door Rob LeVine
Hi,
My Joomla 3.x component makes use of the field type "File Field" so that the user can upload a file. However it's not working correctly as far as I can tell. NOTE: In my case the file field is required, which may make a difference in this issue.
There are a number of issues and I will try to get them all during my description of the issue. When editing an element via the Joomla admin UI, the file field does not display the file that is currently chosen (see attached screen shot). It shows the field label (in my case "Program File Location") and then it shows the Choose File button and next to it is "No File Chosen". First, there has already been a file chosen and it's stored in the database and secondly, if you try to submit the page (i.e., Save) you cannot because there's an error that you form is invalid because you haven't selected a value.
You might then argue that the "View File" link is what someone is supposed to use to see the currently chosen file. I would argue that there should still be made clear that a chosen file already exists and that the user doesn't need to choose another. More importantly is that the View File link contains very incorrect information. In my situation the database value is stored as "amateur_strand_program_1924_02_24_classical.pdf". The file is located in the /media/concert_programs directory on the server. When I use the database value in my UI, I know to prepend the /media/concert_programs/ to it. I would understand if I need to store the full path instead of just part of the path as I do. HOWEVER, the View File still contains way too much information. In my case it looks like this: http://<domain>/administrator/components/com_pso_history/media/concert_programs/amateur_strand_program_1924_02_24_classical.pdf
As you can see it contains the path to the component, which is not correct.
So, as I see it, there are two major issues:
1. That there's no clear way of knowing that you've already selected a file and because of that, when the field is required, you're never allowed to save the page because it's always thought that you haven't selected a value.
2. The View File link contains bad information
NOTE: I just rebuilt the component today so I'm using the latest code on your side.
Please let me know if you need more information or a clarification.
Regards,
Rob
My Joomla 3.x component makes use of the field type "File Field" so that the user can upload a file. However it's not working correctly as far as I can tell. NOTE: In my case the file field is required, which may make a difference in this issue.
There are a number of issues and I will try to get them all during my description of the issue. When editing an element via the Joomla admin UI, the file field does not display the file that is currently chosen (see attached screen shot). It shows the field label (in my case "Program File Location") and then it shows the Choose File button and next to it is "No File Chosen". First, there has already been a file chosen and it's stored in the database and secondly, if you try to submit the page (i.e., Save) you cannot because there's an error that you form is invalid because you haven't selected a value.
You might then argue that the "View File" link is what someone is supposed to use to see the currently chosen file. I would argue that there should still be made clear that a chosen file already exists and that the user doesn't need to choose another. More importantly is that the View File link contains very incorrect information. In my situation the database value is stored as "amateur_strand_program_1924_02_24_classical.pdf". The file is located in the /media/concert_programs directory on the server. When I use the database value in my UI, I know to prepend the /media/concert_programs/ to it. I would understand if I need to store the full path instead of just part of the path as I do. HOWEVER, the View File still contains way too much information. In my case it looks like this: http://<domain>/administrator/components/com_pso_history/media/concert_programs/amateur_strand_program_1924_02_24_classical.pdf
As you can see it contains the path to the component, which is not correct.
So, as I see it, there are two major issues:
1. That there's no clear way of knowing that you've already selected a file and because of that, when the field is required, you're never allowed to save the page because it's always thought that you haven't selected a value.
2. The View File link contains bad information
NOTE: I just rebuilt the component today so I'm using the latest code on your side.
Please let me know if you need more information or a clarification.
Regards,
Rob
Gelieve Inloggen of een account aanmaken om deel te nemen aan het gesprek.
Andres Maeso
Platinum-lid
Posts: 338
10 jaren 5 maanden geleden #102
door Andres Maeso
Andrés Maeso
Customer relations manager at Joomla Component Creator.
Dit e-mailadres wordt beveiligd tegen spambots. JavaScript dient ingeschakeld te zijn om het te bekijken.
Beantwoord door Andres Maeso in topic "File field" field type not working as expected
Hi Rob,
Joomla has an issue on the required file field - they are not validated properly. We are going to report the bug and help to solve it in any way we can.
There are also a few things that I want comment about your post.
Joomla has an issue on the required file field - they are not validated properly. We are going to report the bug and help to solve it in any way we can.
There are also a few things that I want comment about your post.
- All Intenet browsers (Google Chrome, Mozilla Firefox, Internet Explore, etc...) have a security measure that affects file field: they do not allow to set a value for a file field. It prevents that anybody uses malicious code that could provoke security issues. You can read more about this in this article: www.cs.tut.fi/~jkorpela/forms/file.html#value
- About your issue with "View file", the link contains wrong information, if you hover over the [?] in the right of the "Upload directory" field, you will see the following: That message says that every file will be uploaded in the administrator part of your component.
Andrés Maeso
Customer relations manager at Joomla Component Creator.
Dit e-mailadres wordt beveiligd tegen spambots. JavaScript dient ingeschakeld te zijn om het te bekijken.
Gelieve Inloggen of een account aanmaken om deel te nemen aan het gesprek.
Eduardo Mena
Junior Lid
Posts: 31
10 jaren 1 dag geleden #496
door Eduardo Mena
Beantwoord door Eduardo Mena in topic "File field" field type not working as expected
Hello! I'm also having problems with the file field.
I would like to control the folder where the files are uploaded.
Normally, I would do this in the model. But I can't find the function that tells where the file should be stored.
Where can I find it?
Thanks!
I would like to control the folder where the files are uploaded.
Normally, I would do this in the model. But I can't find the function that tells where the file should be stored.
Where can I find it?
Thanks!
Gelieve Inloggen of een account aanmaken om deel te nemen aan het gesprek.
Jovvyb
Nieuw lid
Posts: 2
9 jaren 8 maanden geleden #693
door Jovvyb
Beantwoord door Jovvyb in topic "File field" field type not working as expected
How to override the save functionality??????????
Gelieve Inloggen of een account aanmaken om deel te nemen aan het gesprek.
Gosling Cools
Junior Lid
Posts: 20
9 jaren 7 maanden geleden #729
door Gosling Cools
Beantwoord door Gosling Cools in topic "File field" field type not working as expected
You'll find it under the tables/ directory
Gelieve Inloggen of een account aanmaken om deel te nemen aan het gesprek.
Tijd voor maken pagina: 0.055 seconden