[fw-general] Zend Framework 1.7.5 is now available!

2009-02-17 Thread Wil Sinclair
Hi all,

 

It is my pleasure to announce the release of Zend Framework 1.7.5! You
can download this new mini release from the ZF download site:

 

http://framework.zend.com/download/latest/

 

A list of all issues resolved in this release can be found at:

 

http://framework.zend.com/issues/secure/IssueNavigator.jspa?requestId=10
944

 

We'd like to once again thank our generous Zend Framework contributors
for all the effort they have put in to this release and the project as a
whole. Enjoy!

 

,Wil

 



[fw-general] SECURITY ADVISORY

2009-02-17 Thread Wil Sinclair
The Zend Framework team has been notified of a potential Local File
Inclusion (LFI) attack vector in Zend_View's render() method. To address
the issue, as of the 1.7.5 release the render() method no longer accepts
paths that include parent directory traversal (e.g., "../" and "..\") in
the path argument. This introduces a regression in behavior which can be
addressed by turning off the lfiProtectionOn flag. For more information,
see:

 

http://framework.zend.com/manual/en/zend.view.migration.html

 

If this advisory does not affect your applications, please disregard. We
take security very seriously and will continue to notify all users when
a security fault is discovered.

 

Thank you.

 

,Wil



[fw-general] pure-PHP BigInteger support

2009-02-17 Thread zelnaga

http://framework.zend.com/svn/framework/standard/incubator/library/Zend/Crypt/Math/BigInteger.php

I'm trying to use that in a project of mine and was wondering how difficult
it would be to add pure-PHP support to that?  There's a PHP4 BigInteger
library that could be adapted with relatively little work from the looks of
it:

http://phpseclib.cvs.sourceforge.net/viewvc/*checkout*/phpseclib/phpseclib/Math/BigInteger.php?revision=1.5

Short of updating the functions and variables the make them explicitly
public and private, I'm not sure what else would need to be done to that.
-- 
View this message in context: 
http://www.nabble.com/pure-PHP-BigInteger-support-tp22068811p22068811.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] User uploads file bigger than what's allowed in php.ini, can it be caught?

2009-02-17 Thread bytte

It's really weird. Since I'm using the code from the svn trunk it doesn't
output the MAX_FILE_SIZE in the html code no more. It does show it in the
first form on the same page. 

All my error messages display fine. But still no error message when the user
uploads a file bigger than what's allowed in php.ini

Here the code in my controller:

public function editAction()
{

$toestellen = new Toestellen();
//fetch het toestel met deze id
$row = $toestellen->fetchRow('id=' . $this->id);
$this->view->toestel = $row;
$this->view->title = 'Wijzig ' . $row->naam;
if($row->type == 2) {
$form = new OmgevingForm();
} else {
$form = new ToestelForm();
}
$form->submit->setLabel('Wijzig');
$form->submit->setDescription('of  "' . $this- view->baseUrl() .
'/speelpleinen/toestel/id/' . $this->id . '/speelplein/'.$this->speelpleinId
. '">Annuleer ');
$this->view->form = $form;

//maak bestandenform
$bestandenForm = new BestandenForm();
$this->view->bestandenForm = $bestandenForm;

//toon gekoppelde bestanden
$bestanden = new Bestanden();
$bestandenLijst =
$bestanden->fetchAll($bestanden->select()->where('ref_tabel =
?','toestellen')->where('ref_id = ?',$this->id)->order('created_dt ASC'));
$this->view->bestandenLijst = $bestandenLijst;

if($this->flash->hasMessages()) {
$this->view->formResponse = implode("",
$this->flash->getMessages());
}
if($this->_request->isPost()) {
$formData = $this->_request->getPost();
if(array_key_exists('pic1',$formData)) { //het gaat om 
het toestelform
if($form->isValid($formData)) {
if ($_FILES['pic1']['tmp_name']) {
$formData['pic1'] = 
$_FILES['pic1'];
}
if($row->type == 2) {
$omgevingen = new Omgevingen();

$omgevingen->editOmgeving($formData);
} else {

$toestellen->setFormData($formData);
$toestellen->editItem();
}
//update gelukt - gebruiker laten weten
$this->flash->addMessage("De gegevens 
werden gewijzigd!");

$this->_helper->redirector->gotoUrl('/speelpleinen/toestel/id/'.$this->id .
'/speelplein/'.$this->speelpleinId);
} else {
$form->populate($formData);
}
} else { // het gaat om het bestandenform upload ding
if($bestandenForm->isValid($formData)) {
if ($_FILES['file1']['tmp_name']) {
$formData['file1'] = 
$_FILES['file1'];
}
//doe iets er mee
$bestanden = new Bestanden();
$uploaden = 
$bestanden->saveBestand($formData);
//update gelukt - gebruiker laten weten
if($uploaden) {
$this->flash->addMessage("Het 
bestand werd toegevoegd.");
} else {
$this->flash->addMessage("Er 
was een fout. Probeer opnieuw.");
}

$this->_helper->redirector->gotoUrl('/toestellen/edit/id/'.$this->id .
'/speelplein/'.$this->speelpleinId);
} else {
$bestandenForm->populate($formData);
print_r($bestandenForm->getMessages());
$id = $this->id;
if($id > 0) {
$toestel = 
$toestellen->fetchRow('id=' . $id);

$form->populate($toestel->toArray());
}
}
}
} else {
  

Re: [fw-general] Zend_Form submit not to have a name

2009-02-17 Thread Joó Ádám
Ah, splendid, thank you!


Regards,
Ádám


[fw-general] Zend_Form subforms and getElement

2009-02-17 Thread Thomas VEQUAUD
Hi everyone!

I think this question is for Matthew! ;)

I'm using a multi-page forms with sub forms as indicated in the Zend
manual... The display of the subforms is pretty complicated so I use tables
with getElement method but by this way, I loose the notation form ?> but I
cannot display my form like I want...

-- 
Thomas VEQUAUD  http://thomas.vequaud.free.fr/
Expert EPITECH en Ingénierie Informatique
Tél : +33(0)6.50.39.28.10  Fax: +33(0)9.58.46.10.07


Re: [fw-general] Zend_Form, Validators , Filters, and ini files

2009-02-17 Thread Bob O

Thanks for the help Matthew, its really helping me get my head around it.

So i iterate over the array and Im getting the messages as needed. 

my final issue

I have a select item that i create in Controller and populate it
dynamically. i then add it to my _campaignCreateForm. but when i run the
validation, i get back that its not part of the Haystack?

CODE:

$config = new Zend_Config_Ini(APPLICATION_PATH .
'/config/campaignCreateForm.ini');
$this->_campaignCreateForm = new
Zend_Form($config->advertiser->campaignCreate);
$keywordAssignSelect = new
Zend_Form_Element_Select('keywordAssignSelect', 
array('multiOptions' => array(),
'validators' => array('alnum'),'required' => true));
$keywordAssignSelect->removeDecorator('HtmlTag');
$keywordAssignSelect->removeDecorator('Label');
$this->_campaignCreateForm->addElement($keywordAssignSelect);


and this was the Action method code where is do the iteration

if ($this->getRequest()->isPost()) {
$values = $this->getRequest()->getPost();
if ($this->_fonrootsAdvertiser)  {
  if
($this->_campaignCreateForm->isValid($this->getRequest()->getPost())) {
$campaign =
$this->_fonrootsAdvertiser->createCampaign($values);
$this->flash(("Your Campaign has been created"), '',
'/advertiser/campaigns');
} else {
  foreach ($this->_campaignCreateForm->getMessages() as
$messages) 
  {
foreach ($messages as $message) {
  $this->flash(("Invalid Data: $message\n"), 'error',
'/advertiser/create-campaign');
}
  }
} 
}





Bob O wrote:
> 
> If anyone could point me in a good direction that would be great
> 
> Im trying to get this form to validate
> 
> here is my ini - 
> 
> ; Name Field
> advertiser.campaignCreate.elements.name.type = "text"
> advertiser.campaignCreate.elements.name.options.label = "Name:"
> advertiser.campaignCreate.elements.name.options.validators.notempty.validator
> = "NotEmpty"
> advertiser.campaignCreate.elements.name.options.validators.notempty.options.messages.isEmpty
> = "A Campaign Name required."
> advertiser.campaignCreate.elements.name.options.validators.notempty.breakChainOnFailure
> = true
> advertiser.campaignCreate.elements.name.options.validators.alpha.validator
> = "Alpha"
> advertiser.campaignCreate.elements.name.options.validators.alpha.options.messages.notAlpha
> = "Invalid Campaign Name. Can only contain letter."
> advertiser.campaignCreate.elements.name.options.validators.strlen.validator
> = "StringLength"
> advertiser.campaignCreate.elements.name.options.validators.strlen.options.min
> = "3"
> advertiser.campaignCreate.elements.name.options.validators.strlen.options.messages.stringLengthTooShort
> = "Campaign Name must be between 3 and 8 characters."
> advertiser.campaignCreate.elements.name.options.validators.strlen.options.max
> = "8"
> advertiser.campaignCreate.elements.name.options.validators.strlen.options.messages.stringLengthTooLong
> = "Campaign Name must be between 3 and 8 characters."
> advertiser.campaignCreate.elements.name.options.filters.ucase.filter =
> "StringToUpper"
> advertiser.campaignCreate.elements.name.options.required = true
> advertiser.campaignCreate.elements.name.options.attribs.tabIndex = "60"
> advertiser.campaignCreate.elements.name.options.attribs.alt = "Create
> campaign campaign name field"
> advertiser.campaignCreate.elements.name.options.decorators.type =
> "ViewHelper"
> 
> This is my view - 
> 
>   
> Name:
> 
>   campaignCreateForm->name; ?>
> 
>   
> 
> this is my Controller code -
> 
> $config = new Zend_Config_Ini(APPLICATION_PATH .
> '/config/campaignCreateForm.ini');
> $this->_campaignCreateForm = new
> Zend_Form($config->advertiser->campaignCreate);
> 
> But im at a loss as to how the validations work? 
> 
> thanks
> 


-
Bob Hanson
Web Developer
SLC, UT
-- 
View this message in context: 
http://www.nabble.com/Zend_Form%2C-Validators-%2C-Filters%2C-and-ini-files-tp22019106p22063944.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] User uploads file bigger than what's allowed in php.ini, can it be caught?

2009-02-17 Thread Thomas Weidner
You checked for isValid... but it's not valid and I can't see what you are 
doing with the returned error message.


On the other hand I don't know what your browser does when the file exceeds 
the defined file size in the form.
He could stop transmission, he could prevent to load the file, he could 
display a error message himself, and so on.
It could also be that the browser still sends the file but the web server 
does not accept it.


As you setRequired to true, you should get a failure in any of the above 
cases when the validation fails.

So I expect that you have a general problem displaying error messages.

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

- Original Message - 
From: "Thomas Byttebier" 

To: "Thomas Weidner" 
Sent: Tuesday, February 17, 2009 3:12 PM
Subject: Re: [fw-general] User uploads file bigger than what's allowed in 
php.ini, can it be caught?




Thanks Thomas,
It seems to work now. I get no more exception when uploading files larger
than the allowed upload-size in php.ini. However it doesn't show a user
message telling the user what's going on either.

Thomas

2009/2/17 Thomas Weidner 


Please use r14096 or higher.

I'm sorry...
We had code freeze and a few changes for a new feature were not moved but
now they are integrated and things work like before.

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

- Original Message - From: "bytte" 
To: 
Sent: Tuesday, February 17, 2009 2:09 PM
Subject: Re: [fw-general] User uploads file bigger than what's allowed in
php.ini, can it be caught?




Thanks Thomas. I've used the code from the trunk and now it says:
Fatal error: Cannot access protected property
Zend_File_Transfer_Adapter_Http::$_callbackApc in
/Users/bytte/Sites/my-site/library/Zend/Form/Decorator/File.php on line
114





thomasW wrote:



Who knows ? ;-)
Try so use trunk and see if the problem is still there.

Several automatic additions have been applied there (automatic
setMaxFileSize, exception on missing decorator, automatic encoding).
If your problem is still not solved with trunk add a issue with
reproducable
code.
See the standalone example from my blog and try to reproduce the
behaviour
with how you did your code.

I'm sorry but the small piece of code is not enough for me to see where
the
problem could be.

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

- Original Message - From: "bytte" 
To: 
Sent: Monday, February 16, 2009 12:28 PM
Subject: Re: [fw-general] User uploads file bigger than what's allowed 
in

php.ini, can it be caught?




Bug in my code or bug in Zend Framework?



bytte wrote:



I'm now using setMaxFileSize().

Here's the (reduced for readability) code in my controller to 
retrieve

and
validate the form input. I have two forms on the same page so that's
why
I
do the array_key_exists thing to check which form was submitted. 
Might

not
be the best way of doing things.

file1 is the name of the upload file field.

if($this->_request->isPost()) {
$formData = $this->_request->getPost();
if(array_key_exists('file1',$formData)) {
if($bestandenForm->isValid($formData)) {
if ($_FILES['file1']['tmp_name']) {
$formData['file1'] = $_FILES['file1'];
}
//do something with the file via upload class
   //then redirect user if successful
}
} else {
//other form is submitted, validate and do something with it
}
}



thomasW wrote:



Use setMaxFileSize() instead of adding the field manually.

Beside that it seems like you are doing something wrong when
processing
the
files.
How does your validation/retrievment code looks like ?
This failure is thrown when you are trying to receive a non existant
file
for example.

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

- Original Message - From: "bytte" <
thomas.bytteb...@gmail.com>
To: 
Sent: Tuesday, February 10, 2009 10:51 PM
Subject: Re: [fw-general] User uploads file bigger than what's 
allowed

in
php.ini, can it be caught?




Thanks for the reply Thomas.

I added this line to the form (via Zend_Form of course, but this is
the
html
output):


I'm using Zend Framework 1.7.4 (downloaded about a week ago). I 
have

no
experience with Subversion so I'm not sure how to download the svn
trunk.




thomasW wrote:



Which release are you using ?
Can you try svn trunk ?

How did you add the MAX_FILES_SIZE ?
Where did you add it ?

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

- Original Message - From: "bytte" <
thomas.bytteb...@gmail.com>
To: 
Sent: Tuesday, February 10, 2009 4:43 PM
Subject: [fw-general] User uploads file bigger than what's allowed
in
php.ini, can it be caught?




I'm using Zend_File via Zend_Form_Element_File to let my web
application's
users upload files. I use the following Validators:
$file1->setRequired(true)
  ->addValidator('NotEmpty',true)
 

[fw-general] Do not append view to the body when calling $this->render

2009-02-17 Thread Baptiste Placé

Hello everyone,

I have a question about automatic append of a view when calling 
$this->render('script').
In several controllers actions, I want to return JSON with 2 html code 
into it.
For theses actions, I have e.g. 2 views scripts in the corresponding 
view directory, namely list.phtml and content.phtml.

I want to have the following code to perform this :

// Iterable object used for the list
$this->view->iterablesThings = $things;
$json = array(
   'list' => $this->render('list'),
   'content' => $this->render('content')
);
echo Zend_Json::encode($json);
return;

This make the code for handling ajax and normal request quite similar 
and I like it :)
Anyway, as I dug into the code, I didn't found any method to get the 
result of the render instead of it being appended to the body.

Right now I added the following code in my App_Controller_Action :

public function renderView($action = null, $name = null, $noController = 
false)

{
   $view   = $this->initView();
   $script = $this->getViewScript($action, $noController);
   return $view->render($script);
}

Calling $this->renderView instead of $this->render does the job, but any 
of you know a better way to do this?
Should I initialize things when getting ajax call ? Right now I have in 
the init() :


if($this->getRequest()->isXmlHttpRequest() || 
$this->getRequest()->isFlashRequest()) {

   $this->_layout = false;
   $this->getHelper('viewRenderer')->setNoRender();
   // Other things ?
}

Thanks,
Baptiste.


[fw-general] jotBug update

2009-02-17 Thread Robert Castley
Hi All,
 
If you would like to follow jotbug development then see
http://twitter.com/robertcastley (warning you will also get all the
other mundane stuff in my life!)
 
A working demo is available permantly online at http://jotbug.org (login
in as `jotbug` for full admin access, any other username will give you
reporter level access, no password is required!).
 
Any issues you find then please log at:
http://code.google.com/p/jotbug/issues/list
 
Installation notes at: http://code.google.com/p/jotbug/wiki/Installation
 
Project status at: http://code.google.com/p/jotbug/wiki/Features
 
Wiki macros are working, I only have one macro in place and that is the
bug macro, example wiki syntax is:
 
{macro:bug}#bug{macro} - where #bug is a bug ID e.g. 1
 
OpenID authentication is in but not enabled in the online demo.
 
Cheers,
 
- Robert


This email has been scanned for all known viruses by the MessageLabs Email 
Security Service and the Macro 4 plc internal virus protection system.


Re: [fw-general] How to store attachment files into a location in server

2009-02-17 Thread phpbrat

Hi Anees,

How to fetch all the attachments in a single mail ??
the code below downloads only the first attachment in a mail and not the
other ones..

when fetching for other parts of the mail ie
$part = $message->getPart(3 or 4 );
it doesn't works !


plz reply asap

thanks 

Anees wrote:
> 
> 
> Hi
> am just including the core part of the attachment saving
> 
>//connecting to our remote server for downloding mails using 
> POP3
>   $mail   = new Zend_Mail_Storage_Pop3(array('host'=>
> 'mail.mailserver.com','user'=>'u...@server.com','password'=>'pass123'));
> 
>   //This foreach loop is using to saperate each message as the 
> number of
> messages  
>   $msg= 0;
>   $tot_messages = count($mail);
>   foreach ($mail as $message){
>   
>   $msg++;
>   echo "Reading ". $msg." of ". $tot_messages." 
> Message";
>   $foundPart = null;
>   //Code for finding the body of the message
>   foreach (new 
> RecursiveIteratorIterator($mail->getMessage($msg)) as
> $part) {
>   
>   try {
>   
>   if (strtok($part->contentType, ';') == 
> 'text/plain') {
>   $foundPart = $part;//the body 
> of the message is taken to $foundPart
>   break;
>   }
>   } catch (Zend_Mail_Exception $e) {
>   // ignore
>   }
>   
>   }
>   
>   
>   //Code for checking if the message has attachment then 
> write it to new
> file  
>   $message = $mail->getMessage($msg);
>   /*echo '';
>   print_r($message);
>   echo '';
>   */
>   $attachement="N";  //SETTING attachement= N as 
> DEFAULT
>   echo "FROM:".$message->getHeader('from');
>   if(is_null($foundPart))
>   $foundPart = $message->getContent();
>   if($message->isMultipart()){
>   $part= $message->getPart(2);
>   $type= $part->getHeaders ();
>   $type= $type['content-disposition'];
>   
>   if($type !="inline"){
>   
>   $content= 
> base64_decode($part->getContent());
>   $cnt_typ= explode(";" , 
> $part->contentType);
>   $name   = 
> explode("=",$cnt_typ[1]);
>   $filename   = $name[1];//It is the 
> file name of the attachement in
> browser   
>   //This for avoiding " from the file 
> name when sent from yahoomail
>   $filename   = str_replace('"'," 
> ",$filename);
>   $filename   = trim($filename);
>   
>   $attachement= $filename;//It is for 
> add 
>   }   
>   }
>   
>   
>  //Code for create a new file for the attachement 
>   if($attachement != "N") {
>   
>   //Code for write the file path to the variable 
> myfile to create a new
> file for attachement  
>   $myfile = $_SERVER['DOCUMENT_ROOT'] 
> ."/mail_files/" . $filename;
>   
>   //create a new file and write the attachement 
> to the file
>   $fh = fopen($myfile,'w') or die("can't open 
> file");
>   fwrite($fh,$content);
>   fclose($fh);
>   }
>   
>   
>   $mail->removeMessage($msg); 
>   echo "Message Added to database and removed";   
> 
> } //END OF FOR EACH
> 
> 
> 
> phpbrat wrote:
>> 
>> 
>> i want to download attachment from a pop3/imap mail account 

[fw-general] Changing Zend Forms' HTML - Decorators

2009-02-17 Thread wesleywillians

Hi folks,

I trying, but needed that the zend_form generates a html code like this:



Dados Pessoais
Nome: 
Sobrenome: 
Email: 


-- 
View this message in context: 
http://www.nabble.com/Changing-Zend-Forms%27-HTML---Decorators-tp22057465p22057465.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] User uploads file bigger than what's allowed in php.ini, can it be caught?

2009-02-17 Thread bytte

Thanks Thomas. I've used the code from the trunk and now it says:
Fatal error: Cannot access protected property
Zend_File_Transfer_Adapter_Http::$_callbackApc in
/Users/bytte/Sites/my-site/library/Zend/Form/Decorator/File.php on line 114




thomasW wrote:
> 
> Who knows ? ;-)
> Try so use trunk and see if the problem is still there.
> 
> Several automatic additions have been applied there (automatic 
> setMaxFileSize, exception on missing decorator, automatic encoding).
> If your problem is still not solved with trunk add a issue with
> reproducable 
> code.
> See the standalone example from my blog and try to reproduce the behaviour 
> with how you did your code.
> 
> I'm sorry but the small piece of code is not enough for me to see where
> the 
> problem could be.
> 
> Greetings
> Thomas Weidner, I18N Team Leader, Zend Framework
> http://www.thomasweidner.com
> 
> - Original Message - 
> From: "bytte" 
> To: 
> Sent: Monday, February 16, 2009 12:28 PM
> Subject: Re: [fw-general] User uploads file bigger than what's allowed in 
> php.ini, can it be caught?
> 
> 
>>
>> Bug in my code or bug in Zend Framework?
>>
>>
>>
>> bytte wrote:
>>>
>>> I'm now using setMaxFileSize().
>>>
>>> Here's the (reduced for readability) code in my controller to retrieve 
>>> and
>>> validate the form input. I have two forms on the same page so that's why 
>>> I
>>> do the array_key_exists thing to check which form was submitted. Might 
>>> not
>>> be the best way of doing things.
>>>
>>> file1 is the name of the upload file field.
>>>
>>> if($this->_request->isPost()) {
>>> $formData = $this->_request->getPost();
>>> if(array_key_exists('file1',$formData)) {
>>> if($bestandenForm->isValid($formData)) {
>>> if ($_FILES['file1']['tmp_name']) {
>>> $formData['file1'] = $_FILES['file1'];
>>> }
>>> //do something with the file via upload class
>>> //then redirect user if successful
>>> }
>>> } else {
>>> //other form is submitted, validate and do something with it
>>> }
>>> }
>>>
>>>
>>>
>>> thomasW wrote:

 Use setMaxFileSize() instead of adding the field manually.

 Beside that it seems like you are doing something wrong when processing
 the
 files.
 How does your validation/retrievment code looks like ?
 This failure is thrown when you are trying to receive a non existant 
 file
 for example.

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

 - Original Message - 
 From: "bytte" 
 To: 
 Sent: Tuesday, February 10, 2009 10:51 PM
 Subject: Re: [fw-general] User uploads file bigger than what's allowed 
 in
 php.ini, can it be caught?


>
> Thanks for the reply Thomas.
>
> I added this line to the form (via Zend_Form of course, but this is
> the
> html
> output):
>  name="MAX_FILES_SIZE"/>
>
> I'm using Zend Framework 1.7.4 (downloaded about a week ago). I have
> no
> experience with Subversion so I'm not sure how to download the svn
> trunk.
>
>
>
>
> thomasW wrote:
>>
>> Which release are you using ?
>> Can you try svn trunk ?
>>
>> How did you add the MAX_FILES_SIZE ?
>> Where did you add it ?
>>
>> Greetings
>> Thomas Weidner, I18N Team Leader, Zend Framework
>> http://www.thomasweidner.com
>>
>> - Original Message - 
>> From: "bytte" 
>> To: 
>> Sent: Tuesday, February 10, 2009 4:43 PM
>> Subject: [fw-general] User uploads file bigger than what's allowed in
>> php.ini, can it be caught?
>>
>>
>>>
>>> I'm using Zend_File via Zend_Form_Element_File to let my web
>>> application's
>>> users upload files. I use the following Validators:
>>> $file1->setRequired(true)
>>>->addValidator('NotEmpty',true)
>>>->addValidator('Count',false,array('min' => 1, 'max' => 1))
>>>->addValidator('MimeType', true, array('application/pdf'))
>>>->addValidator('Extension',false,array('pdf'))
>>>->addValidator('Size',false,array('max' => '6MB'));
>>>
>>> It works ok and the validators seem to do their job well but on one
>>> occasion: when the user tries to upload a file that's bigger than
>>> what's
>>> allowed in the server's php.ini file. That value is set to 10MB and
>>> when
>>> I
>>> upload a file of let's say 12MB I just get this error:
>>>
>>> Fatal error: Uncaught exception 'Zend_File_Transfer_Exception' with
>>> message
>>> '"file1" not found by file transfer adapter'.
>>>
>>> If the user tries to upload a file that's bigger than 6MB (as
>>> defined
>>> in
>>> the
>>> Size validator) but smaller than 10MB it's ok as a user-friendly
>>> message
>>> is
>>> shown to the user.
>>>
>>> Is there a way to display a user-friendly message to the user when
>>> he/she
>>>