Page 1 of 1

Copy download file from other table

Posted: 2021-04-12 11:33
by meickert
Hi there,
my AG-App has 2 tables. One is for working - the other only contains templates for table1.

When I click on "use template" in table1 it opens a dropdown with the datasets from table2

Selecting a dataset in table1 copies (all) fields from table2 to table1 on saving (before insert). If no template is used the ckeckbox for "use template" is set to hidden on saving.That all works fine.... but...

Table2 has a upload-file-field. Table1 has a download-link-field.

When copying a template from table2 to table1 the upload-link in table2 should be copied to the download-link-field in table1.

Trying this the database shows me:
table1.download = test.pdf
and
table2.upload = test.pdf

So it seems to work. But....

when I click on the "uploaded-file-link" in table2 it opens: http://localhost/images/test.pdf
clicking on the download-link it opens: http://localhost/test.pdf instead.

So: How can I make every download work like the upload-file-link and always "append" the folder "images" before the filename?

Thanks for your help and sorry for my english :)
Marcus

Re: Copy download file from other table

Posted: 2021-04-12 12:57
by onoehring
Hi Marcus,

is the field type (setting in AG) for table2.upload set to "file"? I assume, that only if this is set to file (not text) the /images folder will be used as a prefix.

Olaf