How to rename a user uploaded file through YAML

So basically i added a form in a theme settings page so the user can upload his own logo, however i want the uploaded file to be called as ‘logo’.png. Is there an option to rename the file?

@dev_on_a_journey, Would you mind sharing why you would like the uploaded file to have predefined name?

When using the file field in the ‘blueprints.yaml’ of your theme, it will save the uploaded file into the desired destination folder and write the file’s properties into ‘/user/config/themes/your-theme.yaml’. Then, in Twig, you can retrieve the uploaded file’s properties (e.g. name, path) by referencing the theme’s config.

See How to: Add a file upload for more explaination and samples.

@pamtbaau Yeah you are right, I’m a beginner I didn’t know that. I solved by using a Twig code took from a theme. Later today I’ll upload the code! Thank you!