Validating a video upload in the Symfony Admin Generator
When using the admin generator to upload a video, my form is acting quite strangely.
If the file is too large, i.e. it is larger than the PHP upload limit, the form displays the first error in the edit.yml file, or no error at all.
My admin g开发者_JAVA百科enerator defines the video in the following way
video_filename:
help: Videos must be .flv or .mp4. Files of up to 32mb can be uploaded.
type: admin_input_file_tag
upload_dir: video
params: include_remove=true include_text=video
I have tried adding a sfFileValidator to no avail.
item[video_filename]:
sfFileValidator:
max_size: 512000
max_size_error: Max size is 512Kb
Is there any way for the admin generator to detect the PHP error and give a more useful error to the user?
You can change the error_reporting setting in config.yml on your app/ it may help
精彩评论