views:

45

answers:

1

I have the next code:

$currFile = new Zend_File_Transfer_Adapter_Http();
$currFile->addValidator('Extension', false, 'jpg');

It works pretty. But if I put array('jpg','png') instead of 'jpg', only files with jpg extendion works.

How can I set more than 1 extension. Thank you for your help.

A: 

Here is an example of Pekka's suggestion:

$currFile->addValidator('Extension', false, 'png,jpg')

As Pekka said, if you have not tried it, try the , separated list. But given that only jpg files work, even if you add the array or comma separated list I would make sure you are modifying the correct file. To test this, remove the jpg all together and just use png and see if that validates alone. If not then chances are you are modifying the wrong file. As for you "not using Zend_File_Transfer" the adapter you are using is an extension of it, so it has access to the same items / features so the Documentation Pekka linked to is relevant.

Brad F Jacobs