Page 1 of 1

Upload more than one file

Posted: 2021-01-16 19:20
by ucevista
Hi there!

I want to make an webapp and upload more than one file for a registry (one by one and not necessary drag and drop).

I thinked to mae tow tables, one for the information of the reistry and another one for files with child records. The idea is that i create a record, upload files (one todaty, tomorrow one, next month another one...) for the same registry.

Can anyone give some heklp with it?

Thanks a lot.

Re: Upload more than one file

Posted: 2021-01-16 21:28
by pbottcher
Hi,

where do you need help. Just set up the tables as you discribe in your text. Like that you have a registry record with as many child record (each with one file).

Re: Upload more than one file

Posted: 2021-01-17 08:50
by ucevista
Hi.

Thank you very much pböttcher. I made that and I can upload files (almost that says the web app after click on save button) but there is no data in list and detail view and into the table.

Re: Upload more than one file

Posted: 2021-01-17 09:11
by ucevista
I found that the files I uploaded are into the images folder, then, they are uploaded correctly but are not shown in the table and there is no data about it in the specific table of documents.

Re: Upload more than one file

Posted: 2021-01-17 09:17
by onoehring
Hi,

if you do not like the images-folder as target you can easily change that in the /defaultLang.php languages file. Look for

Code: Select all

'ImageFolder' => './images/',
and change the name as you like.
but are not shown in the table and there is no data about it in the specific table of documents.
A screenshot would be helpful.
What version of AppGini are you using? If there maybe a bug?
For me in AG 5.92 it works.

Olaf

Re: Upload more than one file

Posted: 2021-01-17 09:50
by ucevista
Ok, I foud the problem but I don't know why is it happening.

The app is for controlling insurances. The involved tables are the three in the picture.

The first one, segurosSeguros, has all the information about the insurance. Second one all information about receipts and bills and the third one the files (pdf in first instance).
Appgini.png
Structure of database
Appgini.png (73.36 KiB) Viewed 2969 times
The field "idPoliza" refers to the "id" of segurosSeguros. The idea is to have one line in segurosSeguros with all information and, after I have contracted an insurance I can click on child table segurosRecibos to insert receipts and segurosAdjuntos to upload files. To have reference I made the idPoliza in the two last tables and are look up fields of segurosSeguros.id.

Well. The table segurosRecibos works fine. I click on new and, if I don't hide this value (only for testing is visible), I can select the policy stored in segurosSeguros but, whe I make the same into segurosAdjuntos that field is in blank, and for that it can't show the documents. If I use HeidiSQL to modify the NULL value and put a number (1 in this example" I can see the document registered.
adjuntos.png
Attachment page with no id
adjuntos.png (11.24 KiB) Viewed 2969 times
Why is not segurosAdjuntos.idPoliza getting the value of segurosSeguros.id?

Re: Upload more than one file

Posted: 2021-01-17 10:20
by ucevista
Ok, it works.

Finally I deleted all files generated from Appgini in webserer, regenerate and it works.

Thanks a lot.

Re: Upload more than one file

Posted: 2021-01-17 12:22
by onoehring
Hi,

great to hear that it works now.
Olaf