Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 739639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:25:25+00:00 2026-05-14T08:25:25+00:00

Hello there i’m trying to create a form with Zend_Form that will enable my

  • 0

Hello there i’m trying to create a form with Zend_Form that will enable my user to upload a unlited number of files to my site, witch is done by javascript.

Something like

<script type="text/javascript">
$(document).ready(function(){
    var image_uploade_i = 0;
    $('#upload_more').click(function() {
        image_uploade_i++;
        $('#upload_list').append('<div id="image_uploade_id_'+image_uploade_i+'" style="display: none;"><input type="file" name="image[]" /><br /></a>');
        $('#image_uploade_id_'+image_uploade_i).slideDown('slow');
    });
});
</script>
<?=$this->translate('Add images')?>
<form action="" method="post" enctype="multipart/form-data">
    <div id="upload_list">
        <input type="file" name="image[]" /><br />
        <input type="file" name="image[]" /><br />
        <input type="file" name="image[]" /><br />
    </div>
    <a href="#" id="upload_more"><?=$this->translate('Upload another image')?></a><br />
    <input type="submit" name="image_uploade" value="<?=$this->translate('Upload images')?>" />
</form>

But i’m am unable to find out how i can create something like this with Zend_From, the only reason i want to use Zend_Form on this thoug is for validation of the uploadet files.

    $element = new Zend_Form_Element_File('image');
    $element->setRequired(true)
            ->setLabel('Profile image')
            ->setDestination($store)
            ->setValueDisabled(true)
            ->addValidator(new Zend_Validate_File_ImageSize(array(
                                        'minheight' => 100, 'minwidth' => 150,
                                        'maxheight' => 1920, 'maxwidth' => 1200)))
            // File must be below 1.5 Mb
            ->addValidator(new Zend_Validate_File_FilesSize(array('max' => 1572864)))
            ->addValidator(new Zend_Validate_File_IsImage());

If any 1 can help me set this up would i be verry great full 😀

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T08:25:26+00:00Added an answer on May 14, 2026 at 8:25 am
    $this->setAttrib('enctype', 'multipart/form-data');
    $this->addElement('file', 'files', array(
        'label'         => 'Pictures',
        'validators'    => array(
            array('Count', false, array('min'=>1, 'max'=>3)),
            array('Size', false, 102400),
            array('Extension', false, 'jpg,png,gif')
        ),
        'multiFile'=>3,
        'destination'=>APPLICATION_PATH . '/tmp'
    ));
    

    so try setMultiFile and possibly use the Count validator to keep a limit.

    I compiled this example from the following source: http://framework.zend.com/manual/en/zend.form.standardElements.html#zend.form.standardElements.file

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My question is about memory use and objects in actionscript 2. If I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.