# Unlink file

**URL:** <https://www.ruby-forum.com/t/unlink-file/142456>\
**Category:** Rails\
**Created:** [July 8, 2008, 6:00am UTC](https://www.ruby-forum.com/t/unlink-file/142456 "2008-07-08T06:00:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaiganez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3ec8ea/32.png) [@jaiganez](https://www.ruby-forum.com/u/jaiganez)\
**Post date:** [July 8, 2008, 6:00am UTC](https://www.ruby-forum.com/t/unlink-file/142456/1 "2008-07-08T06:00:11Z")

</div>

i ve done image/file upload in database as well as in image/file  
folder…& i can able to update the existing files/images in database  
…but i cant able to unlink the old files/images in folder whilke  
update…pls help me…

---

<div class="post-metadata">

**Author:** ![jaiganez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3ec8ea/32.png) [@jaiganez](https://www.ruby-forum.com/u/jaiganez)\
**Post date:** [July 8, 2008, 8:27am UTC](https://www.ruby-forum.com/t/unlink-file/142456/2 "2008-07-08T08:27:05Z")

</div>

Jai Jai wrote:

> i ve done image/file upload in database as well as in image/file  
> folder…& i can able to update the existing files/images in database  
> …but i cant able to unlink the old files/images in folder whilke  
> update…pls help me…

sorry i cant understand your english or query, if you save your image  
data in database why you still need save image folder describtion in  
table too? unless you save your image in host with folder, you maybe  
need to save image folder location in database like you use RMagick. if  
you want update image folder link you only put value (new folder  
name)when update data in controller or if you dont like old folder name  
just delete it.

Reinhart  
[http://teapoci.blogspot.com](http://teapoci.blogspot.com)
