The attached filters will automatically run when receiving the file.
After the file has been received, they will not be attached anymore.

So you must create your file element with all validators and filters attached so they will be processed when you receive the files.

When you access the rename filter manually as shown in your example there is actually no change (but will in 1.7 when it get's accepted).

As we dont know what you are doing in your costom filter, we can not say which failure there is in your implementation. Only thing which I see is that the rename filter accepts three parameters, and you gave two.

Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com

----- Original Message ----- From: "SiCo007" <[EMAIL PROTECTED]>
To: <fw-general@lists.zend.com>
Sent: Monday, November 10, 2008 9:57 PM
Subject: Re: [fw-general] Zend_Form_Element_File



I don't now seem to be able to set filters to run on my uploaded files. I
used to run the filters after I had uploaded the files and validated the
form.

if ($form->isValid($this->_request->getPost())) {

$filter = new SiCo_Filter_File_StoreByDate(DOC_IMAGES .
config::get()->products->images->directory, true);
echo $values['image'] = $filter->filter($values['image']);

}

(The filter call takes a new directory name to which the date is appended in
the filter and whether to overwrite any existing files)

This used to work fine (1.6) now I've moved to 1.7 and it's giving me no end of headaches. I've added the call to receive, but I don't now know where to
put the filters as they don't seem to do anything.

Am I calling them correctly, do they need to work a different way? Can they
be set inside the form?

All I want to do is move the uploaded file to a dated directory, which my
custom filter (extending the rename filter) did perfectly. Now it doesn't do
anything!

-----
Simon

http://www.ajb007.co.uk/
--
View this message in context: http://www.nabble.com/Zend_Form_Element_File-tp20427318p20427618.html Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to