change upload path base on field value

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
ltlow
Posts: 15
Joined: 2021-07-29 09:37

change upload path base on field value

Post by ltlow » 2021-08-26 08:36

I am having a table report which has attachment field. I would like it to upload file to like /Report/$data['field'] base on my field value. I make changes to report.dml.php and change the upload path successfully but the problem now is this does not generate correct link to the attachment. I see this is control by link.php in the this line.

$p = [
'report' => [
'attachment' => getUploadDir(''),
'primary key' => 'id'
],

I am not so good in programming, may I know how can I pass the $data['field'] value to this link.php so it can generate the correct link?

Post Reply