Hi all,

actually i'm working on extending the symfony file upload
capabilities, both for custom forms and the admin-generator.

Scenario is: Upload a file, store pathname and hash in database. That
works fine with my validator, should be going with sfValidatorFile
also by extending the sfXXXForm::processFiles/saveFile -methods.

Ok, but i encountered an issue with the unique validators. These data
are passed when you use this validator with a file upload field (in
both cases, so when i use sfValidatorFiles it is the same as if i use
sfMyValidatorFile)

Array ( [id] => 10 [sf_filebase_directories_id] => [pathname] =>
sfValidatedFile Object ( [originalName:protected] =>
Firefox_wallpaper.png [tempName:protected] => /tmp/phpmSFZje
[savedName:protected] => [type:protected] => image/png
[size:protected] => 705084 [path:protected] => /home/joshi/www/test/
web/uploads ) )

You can see, that the field "savedName" is empty. This seems to result
of the fact that the post validators are executed BEFORE sfPropelForm
says "save the files".

Could anybody confirm this behavior, prove it right or wrong (than
it's a bug) or give me a hint in how to do it the right way?

Note: Ok, i could do it directly in the file validator, checking if
the file already exists. But this is not capable, imagine the case
you'd a tuple with a filename stored i your database, and man wants to
UPDATE this tuple by uploading a new versioned file which though has
the same filename as the file before.

Thanks in advance and a nice weekend,

johannes
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to