Upload more than one file

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
ucevista
Veteran Member
Posts: 30
Joined: 2016-05-08 09:41

Upload more than one file

Post by ucevista » 2021-01-16 19:20

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.

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Upload more than one file

Post by pbottcher » 2021-01-16 21:28

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).
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

ucevista
Veteran Member
Posts: 30
Joined: 2016-05-08 09:41

Re: Upload more than one file

Post by ucevista » 2021-01-17 08:50

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.

ucevista
Veteran Member
Posts: 30
Joined: 2016-05-08 09:41

Re: Upload more than one file

Post by ucevista » 2021-01-17 09:11

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.

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Upload more than one file

Post by onoehring » 2021-01-17 09:17

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

ucevista
Veteran Member
Posts: 30
Joined: 2016-05-08 09:41

Re: Upload more than one file

Post by ucevista » 2021-01-17 09:50

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 1864 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 1864 times
Why is not segurosAdjuntos.idPoliza getting the value of segurosSeguros.id?

ucevista
Veteran Member
Posts: 30
Joined: 2016-05-08 09:41

Re: Upload more than one file

Post by ucevista » 2021-01-17 10:20

Ok, it works.

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

Thanks a lot.


Post Reply