Guess I need to customize the "add item" process so that once a file is uploaded it gets to do the following (in the specific order):
- rename the file;
- duplicate the renamed file;
- add a suffix to the duplicated file;
- move the file without the suffix to another dir;
- only store in db the suffix renamed file.
The user is going to upload a file named xyz.jpg. So, what I want the customization to do is:
- rename the file to its equivalent id key in the db: 1001.jpg (if id=1001);
- duplicate the file and add the suffix _n to the duplicated: got one file named 1001.jpg and another named 1001_n.jpg;
(for what I know of php in the duplicate method the file can be copied (so moved) to other dir);
- only store in the db the data related to 1001_n.jpg.
Have a repository with the "original" files that, from time to time, will be downloaded from the server and stored locally keeping only light versions (xxxx_n.jpg) on the server.
I'm open to suggestions... either pointing me to some documentation you find relevant, or helping me developing this customization or module or what ever you think it would work best.
I'm comfortable with php and mysql.
Thanx a lot.