Forums

Repeter Element with File Upload

carvalhorj 21 Mar, 2019
Hello Everyone

Today I come with a completelly differente challenge: To to have a file upload functionality within a repeter element.

This is my form:


As you can see i can add a series of documents to be uploaded and characterized.

These are my sequence of events: On Successful Validation I execute the Loop_Event, Inside the Loop_Event I upload the files and inside the file upload I have the save to Database Event:



My Issue begins with the Save Event:



Depending on how I ser the Auto Save fields, i get differente results on the database, neither of which attend my needs:



As you can see
1. With "AutoSave" OFF the original file names are saved to the DB (which does not meet my requirements because the files are actually uploades with the timestamp prefix). 2. With the " "AutoSave" ON the files are written with the timetamp prefix (nice) but all in the same row and each row is written as many time as there are files.

From my point of view , I would prefer the files to be uploaded without the timestamp prefix (would save me trouble down the line) but either with, or without, i need a filename per row.

Any help woud be greatly appreciated

Thanks

PS: The 2nd File did not get uploaded because it went over the size threshold, foundthat afterwards, thats why the 3x3 strshape field does not have timestamp on the prefix of 2nd file
healyhatman 21 Mar, 2019
Don't use auto save fields, or untick the auto save to database on the file upload field.
Max_admin 23 Mar, 2019
With or without depends on your needs and how you have the save/upload setup, here you have the "save data" inside a loop, which means that you want to have 1 file per record ? if yes then disable the "auto save" and pass the file field name correctly to the "save data", the file field name under the data array should have the saved file name with the timestamp AFTER the upload has been processed!

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.