How do I change the uploading image file name 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.