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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:05:35+00:00 2026-06-13T08:05:35+00:00

I’ve installed Miles Johnson’s Uploader plugin and set it up with one of my

  • 0

I’ve installed Miles Johnson’s Uploader plugin and set it up with one of my models and got it working perfectly. Very nice.

Then I went and set it up on another model with almost identical code [the only difference is the upload path] and it won’t work on the second model. When I submit the form the plugin doesn’t seem to notice; I get an SQL error from an attempt to insert the POST file array straight into the DB.

Here is the code. [Other than this the plugin is imported in the bootstrap]

public $actsAs = array( 
    'Uploader.Attachment' => array(
        'photo' => array(
            'name'      => 'formatFileName',    
            'uploadDir' => '/uploads/uses/img/',
            'dbColumn'  => 'photo',
            'maxNameLength' => 30,
            'overwrite' => true,
            'stopSave'  => true,
            'allowEmpty'    => false,
            'transforms' => array(
                array('method' => 'resize', 'width' => 240, 'dbColumn' => 'photo_thumb'))
        )
    ),
    'Uploader.FileValidation' => array(
        'fileName' => array(
            'extension' => array('gif', 'jpg', 'png', 'jpeg'),
            'required'  => true
        )
    )
    );

This is on the model that is not uploading and the only difference is the uploadDir.

Does the plugin only work on one model? Any clues? thnx :}


Edit for extra clarity

Here is my view code:

echo $this->Form->create('Use', array('type' => 'file'));
echo $this->Form->input('Use.photo', array('type' => 'file'));
echo $this->Form->input('Use.desc', array('rows' => '3', 'label' => 'Description'));
echo $this->Form->end('Add to Gallery');

And here is my controller code:

public function add() { 
        if ($this->request->is('post')) {       
            $this->Use->set('user_id', $this->Auth->user('id'));        
            if ($this->Use->save($this->request->data)) {
                $this->Session->setFlash('Your Use has been saved.');
                $this->redirect(array('action' => 'index'));
            } else {
                $this->Session->setFlash('Unable to add your Use.');
            }
        }
    }
  • 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-13T08:05:36+00:00Added an answer on June 13, 2026 at 8:05 am

    After checking thru the code with Alessandro [thank you :)] I found the problem.

    If you look in the View and Controller code you can see that the model is named ‘Use’. This was the problem, as Use is a loaded word in PHP and I shouldn’t have used it for a model name.

    I renamed the model to Outcome and now the Uploader works perfectly.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
i got an object with contents of html markup in it, for example: string
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I'm making a simple page using Google Maps API 3. My first. One marker
Let's say I'm outputting a post title and in our database, it's Hello Y’all
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

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.