CodeIgniter Forums
Delete image permanently from upload folder. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: Delete image permanently from upload folder. (/thread-70832.html)



Delete image permanently from upload folder. - hamid - 06-05-2018

Hi,

I have a website & sometimes need to delete & update records from the site. Several records in many tables has image and we upload image to add a new record. But I am not sure whether should we delete the images permanently whenever delete the corresponding records.

Thanks
Hamid Khan


RE: Delete image permanently from upload folder. - php_rocs - 06-05-2018

@hamid,

suggestion...you could just flag the record/image in the table and not show it and if you change your mind later you could just delete all flagged records. I would only discourage keeping old images if hosting space becomes an issue.


RE: Delete image permanently from upload folder. - InsiteFX - 06-06-2018

Code:
table field for soft deletes

deleted tinyint(1) not null default 0,


deleted = 1 image is deleted do not show.
deleted = 0 image is ok so show it.



RE: Delete image permanently from upload folder. - hamid - 06-07-2018

@ php_rocs
@ InsiteFX

Thanks lot for your great suggestions.