Tuesday, November 20, 2012

Zend file upload and addfilter rename isnt working

Ive had spent many days repeatly on different project, stumbling on one same issue.
AddFilter rename isnt working on my file upload.

It was one simple solution,
first, never ever getValue from the field before addfilter rename is in place.

Its very easy that we miss out lines of code where by it tries to populate data model from form.
Also its also easy to accidentally getting value from model to replace upload form field.

Make sure addfilter rename is called before isvalid is checked.

Hope this will solve your hair pulling days figuring why it isnt working.
The worst part is, Zend Framework isnt complaining about it!

No comments: