Drupal Answers Asked by i am batman on December 28, 2021
How do I change the image name while uploading through a file uploading field? In drupal 8 whenever I add an image to a file field, it automatically uploads the image file to my S3 bucket. I need to change the image name before uploading because I need to list my image names with a specific pattern. I searched the internet but couldn’t find a hook for that auto image uploading.
If you're uploading a file I'm assuming it's within a form, right? You could add a submit handler function using form_alter()
(or override the submitForm()
method) and change the file's name using the $form_state
object's setValue()
and getValue()
methods I'm sure.
Answered by AlbionBrown on December 28, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP