Closed hemedani closed 10 years ago
Are the transformed file paths being saved to the database? What version of Cake and the Uploader?
no they don't save in the database cakephp 2.4.9 Uploader v4.4.0 there are no way to deleting file without saving record in the database ??!!
All the paths need to be saved into the database, how else would we know where to delete the file? Add a column for the original file path, and a column for each transform.
tanks a lot each transform has a 'dbColumn' ???
The key in the transform array is the name of the database column. But there is also a dbColumn field too. Either or should work.
tanks
when i deleting record just delete the original file and other files is still on the own dir public $actsAs = array( 'Uploader.Attachment' => array( 'news' => array( 'nameCallback' => 'formatName', 'tempDir' => TMP, 'uploadDir' => 'img/uploads/news/original/', 'overwrite' => true, 'transforms' => array( 'imageSmall' => array( 'class' => 'crop', 'nameCallback' => 'transformNameCallback', 'uploadDir' => 'img/uploads/news/small/', 'overwrite' => true, 'self' => false, 'width' => 500, 'height' => 500 ), 'imageMedium' => array( 'class' => 'resize', 'nameCallback' => 'transformNameCallback', 'uploadDir' => 'img/uploads/news/medium/', 'width' => 800, 'height' => 600, ) )