dynamic folder in upload file
Posted: 2022-03-17 16:44
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.
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.