'File' Field type
Randy Carey
Junior Member
Posts: 23
8 lata 11 miesiąc temu - 8 lata 11 miesiąc temu #1122
przez Randy Carey
'File' Field type was created by Randy Carey
I struggled a bit with a component using this field type to upload a PDF. As I altered the code to get the behavior I wanted, I observed a couple of things to point out...
First, many of the attributed fields that are added to the XML file don't do anything. I now realize that these reflect values pre-set within the CC-generated table class. Example: upload_directory. I do understand that this provides value to me to look up where the uploaded files are supposed to go, but it also cost me a couple of hours trying to wonder why my changes were not taking affect. I don't know the best solution, but do keep in mind that by having these values within the XML form file, we naturally think we can change behavior by changing the attribute values within this XML file. Is it possible to have the table class reads this XML file and take action based upon their settings - instead of hard coding the values to what I initially declared.
Second. I really prefer the option to toggle on/off the MD5 prefix to the file name. In my case, I want the uploaded PDF to have a user-friendly name. I was able to change the code in the table class to bypass the MD5 addition. I added the logic to replace a file with the same name. This also allows the data entry person to overwrite a file that needs to be updated - something I find preferrable. However, by removing the md5 hash and replacing existing files, I did discover some runtime problems (my code tried to remove and resave the same file multiple times because a save process creates four instances of the table class), but I was able to write code that gets past that.
First, many of the attributed fields that are added to the XML file don't do anything. I now realize that these reflect values pre-set within the CC-generated table class. Example: upload_directory. I do understand that this provides value to me to look up where the uploaded files are supposed to go, but it also cost me a couple of hours trying to wonder why my changes were not taking affect. I don't know the best solution, but do keep in mind that by having these values within the XML form file, we naturally think we can change behavior by changing the attribute values within this XML file. Is it possible to have the table class reads this XML file and take action based upon their settings - instead of hard coding the values to what I initially declared.
Second. I really prefer the option to toggle on/off the MD5 prefix to the file name. In my case, I want the uploaded PDF to have a user-friendly name. I was able to change the code in the table class to bypass the MD5 addition. I added the logic to replace a file with the same name. This also allows the data entry person to overwrite a file that needs to be updated - something I find preferrable. However, by removing the md5 hash and replacing existing files, I did discover some runtime problems (my code tried to remove and resave the same file multiple times because a save process creates four instances of the table class), but I was able to write code that gets past that.
Ostatnia8 lata 11 miesiąc temu edycja: Randy Carey od. Powód: improve clarity
Proszę Zaloguj lub Zarejestruj się, aby dołączyć do konwersacji.
Andres Maeso
Platinum Member
Posts: 338
8 lata 11 miesiąc temu #1129
przez Andres Maeso
Andrés Maeso
Customer relations manager at Joomla Component Creator.
Ten adres pocztowy jest chroniony przed spamowaniem. Aby go zobaczyć, konieczne jest włączenie w przeglądarce obsługi JavaScript.
Replied by Andres Maeso on topic 'File' Field type
Hi Randey
I've shared your views with one of our developers and he will come back to you using our ticket system. He's actually been working with the file field last week so I think it comes right in the best moment.
Regards,
Andrés.
I've shared your views with one of our developers and he will come back to you using our ticket system. He's actually been working with the file field last week so I think it comes right in the best moment.
Regards,
Andrés.
Andrés Maeso
Customer relations manager at Joomla Component Creator.
Ten adres pocztowy jest chroniony przed spamowaniem. Aby go zobaczyć, konieczne jest włączenie w przeglądarce obsługi JavaScript.
Proszę Zaloguj lub Zarejestruj się, aby dołączyć do konwersacji.
Czas generowania strony: 0.051 s.