Welcome to SOes: D your question has 2 parts:
- The use of
jQuery File Uploader for uploading files.
- The architecture at the database level for managing files.
I help you with the database: D I recommend you do the following:
Add a pair of tables called:
EnlaceArchivosRegistros (* consider that the word
Registros refers to the other table you have storing the data)
The relationship of these tables is:
Archivo has one or many
Registro has one or many
EnlaceArchivosRegistros table contains basically (as a recommendation):
- Unique ID.
- File ID.
- Registry ID.
- Creation date.
- Data of the user who created it.
Archivos table will have:
- File name
- Physical path where it is
- Date and time of creation
- User who created it
With this, your business logic remains almost intact:
the difference lies in instead of passing the file directly, now save it in another table and if you have many more files to upload, you add them to
Archivos and create a new record in the table
Please note that to complete this suggestion, you must migrate the document routes of the table you have running and create the relationships with the
The query will change when you want to show the information, since you will need to include 2 more tables, also in the view you will have to do
foreach to visualize all the data obtained from the list of linked files.
I hope you have let me understand, any questions / questions you have, add a comment that we all learn: D