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

  • Home
  • SEARCH
  • 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 3802526
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:13:21+00:00 2026-05-19T14:13:21+00:00

I’m noticing something strange and was wondering if someone could test my code on

  • 0

I’m noticing something strange and was wondering if someone could test my code on their side and let me know if they get the same thing.

I have a real simple form (see full form code and action code below) which only has a file upload + hidden hash + submit button. The file upload has a max size limit set to 10000000 (about 9.5MB).

When I try to upload a file bigger than the limit, the form isn’t supposed to validate, but I get an error in the hash token itself Value is required and can't be empty. Can someone confirm? It looks like the token is being wiped out. I’m guessing this could happen in the case of a redirect or something, but I’m not doing any redirects, unless there’s something happening in the background that I’m not noticing.

Here’s the form code and my action code

class Application_Form_TestForm extends Zend_Form
{

    public function init()
    {   

    $file = new Zend_Form_Element_File('file');
    $file->setDestination(APPLICATION_PATH);
    $file->addValidator('Size', false, 10000000);
    $file->setMaxFileSize(10000000);
    $this->addElement($file);

    $hash = new Zend_Form_Element_Hash('hash');
    $hash->setIgnore(true)
         ->setSalt('mysalt');
    $this->addElement($hash);  

    $submit = new Zend_Form_Element_Submit('submit');       
    $submit->setLabel('Test')
           ->setIgnore(true);            
    $this->addElement($submit);  

    $this->setAttrib('enctype', 'multipart/form-data');
    $this->setMethod('post');
}
}

In my controller, I do the usual validation

public function indexAction()
{
    $form = new Application_Form_TestForm();
    $this->view->form = $form;

    if($this->_request->isPost()){          
        echo "post";
        if($form->isValid($this->_request->getPost())){
           echo " valid";
        }
    }

}
  • 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-19T14:13:22+00:00Added an answer on May 19, 2026 at 2:13 pm

    This seems to be related to your post_max_size or upload_max_filesize values in your php.ini. For example, default value of post_max_size is 8M which is less than your max file size.

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

Sidebar

Related Questions

No related questions found

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.