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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:58:06+00:00 2026-06-18T05:58:06+00:00

I am trying to get files to upload using cakephp I am currently using

  • 0

I am trying to get files to upload using cakephp

I am currently using a tutorial but have come across some errors, especially with the move-uplaoded-file.

Error : Indirect modification of overloaded property UploadsController::$data has no effect

I see that my upload does actually create an array with details of the information in it, it just doesn’t pass it to the database or move the tmp file.

Here is my uploading function:

function uploadFile() {
    $file = $this->data['Upload']['file'];
    if ($file['error'] === UPLOAD_ERR_OK) {
        $id = String::uuid();
        if (move_uploaded_file($file['tmp_name'] , APP . 'uploads'.DS.$id)) {
            $this->data['Upload']['uploadID'] = $id;
            $this->data['Upload']['fileName'] = $file['name'];
            $this->data['Upload']['fileSize'] = $file['size'];
            $this->data['Upload']['fileType'] = $file['type'];
            return true;
        }
    }
    return false;
}

Any help would be great, thanks!

  • 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-18T05:58:07+00:00Added an answer on June 18, 2026 at 5:58 am

    In order to get the data sent by the form (in your case the file itself) you must use
    $this->request->data instead of $this->data.

    I hope this helps.

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

Sidebar

Related Questions

I'm trying to upload some videos using PHP. But I can't get them into
I’m trying to upload files to Amazon S3 using AWS::S3 , but I’d like
currently I'm trying to get multi upload in my admin interface working. I'm using
I am currently trying to get multiple xml files into my xsl file to
I'm trying to upload a file to my server using the CakePHP file upload
I'm trying to upload multiple files using <input id=testUpload type=file multiple=true/> (yes, i know
I'm trying to upload a file using Ajax, but I'm having troubles handling the
I am trying to upload files using Spring CommonsMultipartResolver however the controller is not
I am trying to upload multiple files from jsp using below code: When I
Trying to upload files using Google Gears and ASP.NET... I assume you can as

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.