Glad I could help! Rock on :)
On Mar 31, 12:04 pm, HAUSa
jeroen_heeft_behoefte_aan_r...@hotmail.com wrote:
Campezzi, thanks a lot! This indeed works! I did the Jobeet tutorial,
but oviously I read over it.
public function generateFileFilename(){
return
I didn't test this, but I remember seeing something like that in the
Jobeet tutorial:
If a generateLogoFilename() method exists in the model, it will be
called by the validator and the result will override the default
generated logo filename. The method is given the sfValidatedFile
object as an
Campezzi, thanks a lot! This indeed works! I did the Jobeet tutorial,
but oviously I read over it.
public function generateFileFilename(){
return 'testnow.pdf';
}
My file has a neat testnow.pdf file name on upload.
On 31 mrt, 15:05, Campezzi
It's pretty useful when you have two files with the same name
uploaded. You can get the original filename via
sfValidatedFile-getOriginalName()
An instance of sfValidatedFile is returned by sfValidatorFile by default.
On Mon, Mar 30, 2009 at 11:51, HAUSa
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
$form-bind($request-getParameter($form-getName()), $request-
getFiles($form-getName()));
if ($form-isValid())
{
$file = $this-form-getValue('your_file_fieldname');
if(!is_null($file))
{
$filename = $file-getOriginalName()
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 jeroen_heeft_behoefte_aan_r...@hotmail.com
wrote:
Thx for your reply Joan!
I do understand your
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
jeroen_heeft_behoefte_aan_r...@hotmail.com wrote:
Fási, thank you too! But I
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
hi,
the solution of Tomasz maybe more easy than creating a new class.
Here (http://www.symfony-project.org/api/1_2/sfValidatedFile) you can find
the documentation and the methods getOriginalName and others.
Joan
2009/3/30 Tomasz Ignatiuk tomek.ignat...@gmail.com
10 matches
Mail list logo