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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:10:02+00:00 2026-06-07T06:10:02+00:00

I am trying to get my head around the documentation for installation and use

  • 0

I am trying to get my head around the documentation for installation and use of this Uploader plugin for CakePHP 2.x which deals with uploading of files. I have a few questions I hope somebody could help me with. There’s quite a good thread on the topic, Installing Uploader Plugin for CakePHP 2.x, but I wanted to clear some things out which are not that clear in the thread (to me at least).

Btw the authors page: http://milesj.me/code/cakephp/uploader

Is it right that if you want to save manually (without the behaviour), the installation is as follows:

CakePlugin::load('Uploader'); // THIS GOES INTO THE BOOTSTRAP.PHP FILE PER THE REFERENCED QUESTION ANSWER
App::import('Vendor', 'Uploader.Uploader'); // THIS GOES INTO CONTROLLER PER THE REFERENCED QUESTION ANSWER
$this->Uploader = new Uploader(); // THIS GOES INTO CONTROLLER PER THE REFERENCED QUESTION ANSWER

Is that right?

BUT, if you are using the behaviour instead you don’t do ANY of that above for installation, instead you do ONLY in model:

public $actsAs = array('Uploader.Attachment');

Is that right?

Is chapter 2 of the documentation only applicable for when using the plugin manually? Otherwise, you configure the model behaviour per chapter 3 only in the model.

Final question: So if I understand this right (I am still a little new to CakePHP), if I am using the behaviour to do the save automatically, whenever I upload a file to that model, it will automatically save the file in the right folder without me having to do anything and put a reference in the $data variable which is pointing to the saving location?

Thanks in advance!

  • 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-07T06:10:04+00:00Added an answer on June 7, 2026 at 6:10 am

    I had such trouble getting this to work and understanding the whole plugin and behaviour thing so I thought it would be worth sharing quickly what I have learnt in a short video on how to install, implement and use the Uploader plugin through the model behaviour.

    http://www.youtube.com/watch?v=lMNUOz8wqzE

    Hope you find it helpful. To answer my questions above, I basically only have to:

    1. Include the CakePlugin::load('Uploader'); in the bootstrap.php
      file which can be found under App/Config/
    2. Call the behaviour inside my model as per public $actsAs =
      array('Uploader.Attachment');
      but with the relevant options
      configured
    3. Then just save to the model, through my controller, and in the model I have included the $actsAs variable

    The beforeSave callback function which has been defined in the Attachment behaviour in the Plugin will take care of the rest.

    Uploading file seems to be such a mundane tasks so I suppose it is very appropriate to do it through a behaviour, and I don’t want to write my own behaviour given my own beginners level so it’s good that Miles has, particularly since he’s an experienced developer. After reading up, uploading files using controller code is not the way to go, using expert developers plugin’s probably is THE way to go.

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

Sidebar

Related Questions

I am trying to get my head around this query - seems pretty straight
Trying to get my head around backbone.js. This example is using Backbone Boilerplate and
Really trying to get my head around this but cannot see the light through
Im trying to get my head around javascript inheritance and this code doesnt work
I'm trying to get my head around to understand how to use closures in
I'm trying to get my head around this isReusable property of the IHttpHandler interface
Just trying to get my head around Generics by reading this enlightening article by
trying to get my head around Feedzirra here. I have it all setup and
Trying to get my head around how to integrate fancyBox with an aspx c#
Just trying to get my head around what can happen when things go wrong

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.