Asset Management Question
Hi,
I have a module where I can upload an asset. The asset name is also saves in the database table.
Now if the record is updated with a new asset, I want to delete the old one on the file system.
In which hook do I have access to the new filename and the old one from the database so I can check for the difference of the two filenames?
Comments
my problem is that in the input parameter $values of on_before_save the new value is not available, only the old value. So I do not know if the image has changed at this moment.
do you have a method implemented to read the last modified timestamp of an asset on the filesystem? do get the datetime when it was uploaded...
http://www.codeigniter.com/user_guide/helpers/file_helper.html#get_file_info
Then I will use that to write an own helper function to get the filesize. Thanks!