While saving the form data in your action, you can get the sfValidatedFile instance by calling $form["file"]->getValue(), and that has the getOriginalName() method I was referring to.
On Mon, Mar 30, 2009 at 12:46, HAUSa <[email protected]> wrote: > > Fási, thank you too! But I do not understand about sfValidatedFile- >>getOriginalName(). I'm working in my form class, in sfValidatorFile. > I cannot use those functions there. > > > On 30 mrt, 12:43, HAUSa <[email protected]> > wrote: >> Thx for your reply Joan! >> I do understand your explaination op the sfValidatedFile class. >> But, how do I overwrite / extend the sfValidatedFile? Should I create >> a class in my lib directory? And how do I overwrite the file name? >> >> I searched the Symfony website, but I cannot find any information >> about that. >> >> On 30 mrt, 12:04, Joan Teixidó <[email protected]> wrote: >> >> > Hi, >> >> > when the sfValidatorFile clean the file, it's convert to instance of >> > sfValidatedFile. This class makes the save and md5 of the file. You can >> > create a new class to manage a validated file, and pass the name of this >> > class to the sfValidatorFile (it's the option: validated_file_class.) What >> > i >> > do is to create a class that extends sfValidatedFile and make my own save >> > method. >> >> > The sfValidatedFile class is into the same file of sfValidatorFile. >> >> > good luck! >> >> > Joan >> > From Catalunya >> >> > 2009/3/30 HAUSa <[email protected]> >> >> > > When I upload a file using sfWidgetFormInputFile() and sfValidatorFile >> > > (), it gets some sort of MD5 / SHA1 filename. For example, >> > > cf95672e445d03249959d832441ff5095b6b6d12.docx. >> >> > > Is it possible to keep the original file name, eventually slugified? >> >> > > Example: >> > > Upload: our marketing plan.docx >> > > File: our-marketing-plan.docx > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
