⚠ 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

Is there any callback available when deleting an uploaded file (not 1 row data)?



SilentSeth

SilentSeth
  • profile picture
  • Member

Posted 06 April 2013 - 09:04 AM

Hi all,

 

As stated in the title, is there any callback available when we delete an uploaded file? (Not deleting the data row, only the uploaded file).

 

Simply speaking, I create a thumbnail, and when I delete the original image, I want to delete the thumbnail as well.

 

Thanks. 


davidoster

davidoster
  • profile picture
  • Member

Posted 06 April 2013 - 10:26 AM

As far as I am aware of, no there isn't one.

Probably you need to check with js for deletion of the uploaded file.

You can also make some procedure to be called ON update within your db.


SilentSeth

SilentSeth
  • profile picture
  • Member

Posted 08 April 2013 - 06:59 AM

I see.. noted that. Thank you for confirming. 


Heyder

Heyder
  • profile picture
  • Member

Posted 05 January 2019 - 07:50 AM

I do not know whether it is right or not, but it worked for me.

Codeigniter/libraries/Grocery_Crud.php  line:1503

add line 

unlink("{$upload_info->upload_path}".'/thumb_directory/thumb-'."{$state_info->file_name}");

I have an original image example.jpg and in accordance with thumbnails thumb-example.jpg