Hi,
If you're using Doctrine, you can create
public function postDelete($event) {
@unlink(sfConfig::get('sf_upload_dir').'/immobili/original/'.$this->fotoPrincipale);
@unlink(sfConfig::get('sf_upload_dir').'/immobili/big/'.$this->fotoPrincipale);
}
in your model file.
If you're using Propel, you can extend delete method of your model
file or create another behaviour.
Thanks.
2009/12/23 ilcaduceo <[email protected]>:
> Hi all, I've a simple form with sfFormWidgetInputFileEditable for
> simple upload of photos:
>
> $this->validatorSchema['fotoPrincipale'] = new sfValidatorFile(array(
> 'required' => false,
> 'path' =>
> sfConfig::get('sf_upload_dir').'/immobili/original',
> 'mime_types' => 'web_images',
> 'validated_file_class' => 'sfResizedFile'
> ));
>
> $this->widgetSchema['fotoPrincipale'] = new
> sfWidgetFormInputFileEditable(array(
> 'label' => 'Foto principale',
> 'file_src' => '/uploads/immobili/big/'.$this->getObject()-
>>getFotoPrincipale(),
> 'is_image' => true,
> 'edit_mode' => !$this->isNew(),
> 'with_delete' => false,
> 'template' => '<div>%file%<br />%input%<br />%delete%
> %delete_label%</div>'
> ));
>
> I've also an admin generated backend interface, but I want to delete
> the photo uploaded when the record is deleted.
>
> How to this? Thanks for help me...
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "symfony users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en.
>
>
>
--
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en.