Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Removing Attachement in links

Quote Reply
Removing Attachement in links
     I added a "file" type field into links properities to allow admin to attach a file to a link, and I created a directory to have the attached files stored in it (/home/attachements/). However, when I view a link and replace the attachement, or delete the whole link, the attachement gets deleted, but the directory that the attachement was in it is still there???

Is there anyway, when I delete an attachement, the directory that stores that attachement gets deleted as well as I am associating the storage directory with the ID of the link. I have this structure where the number (7,9,12) presents the ID of the link and is the same as the directory name that gets built when I attach a file; however, things will not be in synch if I delete, update, add new links with attachements:

/home/attachements/7/stars.jpg
/home/attachements/9/car_image.gif
/home/attachements/12/nature_seen.jpg
.... etc.
If no solutions, then would it be possible to store these files in the SQL database instead of on the local drive....

Thanks...