I want alter the URI's files before they are stocked in the server. The file insert, I mean, everywhere/time a file is uploaded via Drupal (all insert file process, not only when an user add a file via a form)
Is it possible ?
An example : With drupal defaults settings, files ares stocked in the files directory (drupal/sites/default/files)
I want stock files in another directory (out of drupal main directory, by exemple in the directory /save/files)
And
I want to organize files like this : files/pictures/01_May files/pictures/02_May ... files/pictures/day_month (its an exemple for pictures, maybe there is another structure for the video etc..)
So, when the user or the drupal code (.module, via the drupal api) upload a file to the server I want automatically stock this file in the directory /save/files) With the hook insert I can change the URI of the file, but during the hook insert the file is ulready uploaded in the server.
I'm looking for a way for move any files uploaded to the good directory before files are stocked in the server