Closed clarkritchie closed 12 years ago
Excellent point! I can't think of a way to handle it in the plugin, this might have to be handled in the delete() function of the controller.
One way I can think of is to expose a function that returns the directory name - or even a delete() function that deletes the files directory for that specific object directly. Do you have any suggestions on the best method?
I'll try to release a new version soon that includes this function.
That's basically what I was thinking - you'd have to call a method from the object's controller on delete. I don't know enough about Cake to intelligently suggest how, from your controller, you get back a list of associated files that you could then iterate through, deleting one by one, or at least warn the user that files associated with that object will be deleted.
I'm really hoping to use this plugin, I've played around with a few ways to do file uploads in the last day or two and this was by far the easiest to implement -- and has the easiest to use features, namely drag-drop, and multi-file support.
OK, I'll try to have this feature over the coming week and let you know as soon as its done.
Fixed in latest release (v 1.0.3.) :)
Please check. Note that you will need to add the plugin component to any existing component to get this to work (or you can follow the docs for a new app.)
This is a nice looking plugin, and I'm hoping to use it.
Deleting files on the edit view works great, but what if a user deletes an object that has files attached -- is there any way to trap this so any attached files can also be removed from the filesystem? Otherwise they are orphaned.
Thanks!