⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

How to change the uploaded file name?



masai
  • profile picture
  • Member

Posted 29 September 2012 - 09:25 AM

Hi,
when I upload a file, I would like to change the name of the file with a prefix (the ID of that record). So, if the file name is 'name.jpg', I need '158_name.jpg' as final name.
How can I do that?

Thanks

victor
  • profile picture
  • Member

Posted 29 September 2012 - 13:44 PM

HI! use a callback function.
for example when you will add a new data use the callback_after_insert .