Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get uploaded file name and size before validating that file using zend addvalidator
    primarykey
    data
    text
    <p>when using zend add validators for validating a file size and extension.Is it possible to track the file name and size of the file uploaded.Can we get the size and name of the file even when validation fails.I cant track the file name when validation fails as the file not coming to temp directory when validation fails.Is the file validated before storing in temp directory</p> <p>here is my code snippet:</p> <pre><code> $document_path_field = $this-&gt;CreateElement('file','document_path'); $document_path_field-&gt;setLabel('Document'); $document_path_field-&gt;setAttrib('class','button'); //$document_path_field-&gt;setDestination(SUPPORTING_DOCUMENT_DIRECTORY); $document_path_field-&gt;addValidator('Count', false, 1); $document_path_field-&gt;addPrefixPath('Course_Validate_File', 'Course/validate/File', 'validate'); $document_path_field-&gt;addValidator('Size', false, 1000000); $document_path_field-&gt;addPrefixPath('Course_Validate_File', 'Course/validate/File', 'validate'); $document_path_field-&gt;addValidator('CheckExtension',false,'docx,doc,jpg,png,gif,pdf'); $document_path_field-&gt;clearDecorators(); if(isset($field_required_array['document_path']) &amp;&amp; $field_required_array['document_path'] == "Yes") { $document_path_field-&gt;setRequired(true); } else { $document_path_field-&gt;setRequired(false); } $document_path_field-&gt;setDecorators($this-&gt;setFieldElementDecorators()); if(in_array('document_path',$field_names_array)) { array_push($form_elements,$document_path_field); } $current_document_path = $this-&gt;CreateElement('hidden','current_document_path'); $current_document_path-&gt;setLabel('Current Document') -&gt;clearDecorators() -&gt;addDecorator($imageviewScript) -&gt;setValue($this-&gt;_document_path); array_push($form_elements,$current_document_path); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload