Hello, hope everyone is doing well.
I have been researching how to control file attachments in my custom doctype within a custom app. I would like to control the naming of the file and the folder the files end up in. I would like to use the Attach field but I don’t see any triggers that are usable in upload.js, file_manager.py, handler.py, or control.js.
I thought I would hijack the on_upload_complete from control.js. It works, I get the attachment but it is already named and stored.
- Is there a way to manipulate files on the file system after they are saved?
- Is there a better way to change the file name to be saved before the file is saved the first time? Using built-in functions…
I am aware I can write my own code to do all this but it would be nice if there where a before_save event triggered.
Thank you,