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 8498943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:32:18+00:00 2026-06-11T00:32:18+00:00

I am trying to create a upload plugin. I am keeping all the logic

  • 0

I am trying to create a upload plugin. I am keeping all the logic in behavior. This thing was working all fine by yesterday and from no where this strange problem is surfaced.

/*controller code */
debug($this->request->data);
$this->Model->saveAll($this->request->data);

/* outputs
Array
(
   [Ad] => Array
    (
        [s] => 2
        [d] => 2
    )

    [Upload] => Array
    (
        [field] => Upload
        [table] => Ad
        [filename] => Array
            (
                [name] => index.php
                [type] => application/x-php
                [tmp_name] => /tmp/php3MbvRh
                [error] => 0
                [size] => 32
            )

    )

)

 */

I am developing a plugin. In plugins beforeSave() i debug the same data and it shows

public function beforeSave(Model $Model) {
    debug($Model->data);
}

/* outputs
Array
(
    [Upload] => Array
    (
        [1pload] => 
    )

)
*/

Everytime there appears a number for the fields property. Sometimes its 1, 8 and/or 9. 🙁

  • The plugin is loaded fine from bootstrap.php (CakePlugin::loadAll())
  • The plugin uses uploads table. The model of which is maintained as model.
  • The plugin behavior is properly defined and was working perfectly. NOT NOW
  • 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-06-11T00:32:20+00:00Added an answer on June 11, 2026 at 12:32 am

    I couldn’t figure out the problem. But the debug() in beforeSave() was being executed several times. So, I added in the plugin

    if( isset ($this->data['preferred']['data'] )  {
    
    }
    

    For first few passes it is still something similar but on the third or fourth time it does show the data.

    So, I have come with a theory that the beforeSave in plugin was being asynchronous to that of model’s beforeSave and if i put a check then that would solve the issue. In fact it did.

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

Sidebar

Related Questions

I'm trying to create a controller to upload photos in my MVC4 application. But
I am trying to create a PHP file to upload images to my website.
I'm trying to create a dialog which will allow users to upload an image.
I am trying to upload a file with playframework. I create a form and
Trying to create a facebook app just to learn and coming across a strange
I am trying to create a upload form using servlets, and so far i
js.I am trying to create a file upload using node.js and mongodb.I am getting
How it works: I'm trying to create an instant upload function with Jquery/Ajax. When
I'm trying to create a simple file upload form for my website. I'm using
I'm trying to create a custom file upload control in WPF 4.0 and I'm

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.