Problem:
The 'Filefield Path' module can be used to dispatch and/or rename uploaded files to sub-folders under the 'File system path' (defined in 'Site configuration'->'File system'). However, this does NOT avoid the filename collision issue, because the dispatching or renaming happens too late. Files were firstly uploaded to the 'Temporary directory'. In the 'Temporary directory', if two 'a.jpg' collide, one of them is renamed to 'a_0.jpg'.
Solution?
1. Is there a way to rename the uploaded files to something like [mm][dd]_[filefield_filename] before they are put into the 'Temporary directory', so that they become '0527_a.jpg' and '0528_a.jpg' rather than two 'a.jpg'?
Or 2. Is there a way to upload files to sub-folders (automatically created according to tokens) of 'Temporary directory', like '/tmp/[mm][dd]/[filefield_filename]'?
Or 3. Is there a way to frequently / safely cleanup the 'Temporary directory'?
Thanks in advance!