Hello there.
I found myself needing to be able to dynamically change the location where each file will be uploaded in a form, for example images/tablename/id.
This is possible if you could modify the 'dir' variable of the fileUpload function.
But it is not possible for me unless it is written within the base code of the application, which would be modified each time it is compiled.
I also did not find a way to pass it by parameter from the hooks functions.
On the other hand, I also found that the folder was not generated for me, and I found that the mkdir function of the PrepareUploadedFile function was missing the recursion true.
I think that it is not very far from being able to solve the first point, to be able to pass the folder by parameter.
But the second point I think can be solved with the next version
Greetings Alejandro.
dynamic folder in upload file
- landinialejandro
- AppGini Super Hero
- Posts: 126
- Joined: 2016-03-06 00:59
- Location: Argentina
- Contact:
dynamic folder in upload file
Alejandro.
AppGini 5.98 - Linux OpenSuse Tumblewweed.
Some of my posts that may interest you:
Landini Admin Template: Template for Appgini like AdminLTE
Profile image plugin: add and changue image user profile
Field editor in table view: Configurable fast edit fields in TV
my personal page
AppGini 5.98 - Linux OpenSuse Tumblewweed.
Some of my posts that may interest you:




Re: dynamic folder in upload file
Why not use before* hooks, create subfolder depending on PK and change filename in DB?
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readability- landinialejandro
- AppGini Super Hero
- Posts: 126
- Joined: 2016-03-06 00:59
- Location: Argentina
- Contact:
Re: dynamic folder in upload file
Hi Jan, I'm going to try that, but it seems a bit far-fetched to me, maybe it's better in the after hook, so appgini finishes all its upload process, and I move the file to the folder I need. maybe... hahaha.
Although I still think that the suggestion could work better.
Thanks for your support.
Saludos Alejandro
Although I still think that the suggestion could work better.
Thanks for your support.
Saludos Alejandro
Alejandro.
AppGini 5.98 - Linux OpenSuse Tumblewweed.
Some of my posts that may interest you:
Landini Admin Template: Template for Appgini like AdminLTE
Profile image plugin: add and changue image user profile
Field editor in table view: Configurable fast edit fields in TV
my personal page
AppGini 5.98 - Linux OpenSuse Tumblewweed.
Some of my posts that may interest you:




Re: dynamic folder in upload file
Both should be possible. If you intercept before* you will have access to $_FILES array, additionally. For example I am using before_insert hook for fetching the file's original filename and storing it in DB. Having the (unchanged) filename in DB next to the generated unique filename helps my users finding attachments using built-in search function. So, before* can bring some benefit. But you are right: both should work.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readability