Hi

Question: How can I get Drupal inform me of ALL inserts it is performing into /sites/default/files/?

I have implemented within my module hook_file_insert().

When I upload an image Elephant.jpg, then Drupal calls this hook with file information of uri containing public://field/image/Elephant.jpg, and this file exists within sites/default/files/field/image.

However, Drupal does other stuff to this image, and places a copy image (respective of it rendering) into one or more of these sub-directories /sites/default/files/styles/:

  • sites/default/files/styles/large/field/image
  • sites/default/files/styles/medium/field/image
  • sites/default/files/styles/thumbnail/field/image

Drupal does not inform me of these image renderings.

Thereby, three additional images are inserted into directory /sites/default/files/ without calling hook_file_insert()

  • public://styles/large/field/image/Elephant_web.jpg
  • public://styles/medium/field/image/Elephant_web.jpg
  • public://styles/thumbnail/field/image/Elephant_web.jpg

So, how can I get Drupal to tell me the whole story of what is happening to ALL files that move in and out of /sites/default/files/?

Thanks