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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:45:52+00:00 2026-05-20T04:45:52+00:00

I am using move_uploaded_file to upload files in cakephp, this was working for a

  • 0

I am using move_uploaded_file to upload files in cakephp, this was working for a while, but suddenly it broke. (I don’t seem to see any recent changes in svn that relate to this issue, so I can’t just revert them).

The problem is, move_uploaded_file is returning false, but it isn’t telling me what’s wrong. I tried doing:

error_reporting(E_ALL);
ini_set("display_errors", 1);

but it isn’t accomplishing anything. No errors are being reported.

if (!file_exists($folder_url . '/' . $filename))
{
    // create full filename
    $full_url = $folder_url . '/' . $filename;
    $url = $rel_url . '/' . $filename;
    // upload the file
    error_reporting(E_ALL);
    ini_set("display_errors", 1);
    $success = move_uploaded_file($file['tmp_name'], $url);
    $result['success'] = $success;
    $result['debug']['url'] = $url;
    $result['debug']['full_url'] = $full_url;
    $result['debug']['file'] = $folder_url . '/' . $filename;
}

Hosting server is in ubuntu server 9.10 running LAMP, development machine is windows 7 running XAMPP

EDIT:

I changed the activate error reporting to before the upload and it still doesn’t work:

error_reporting(E_ALL);
ini_set("display_errors", 1);
$success = move_uploaded_file($file['tmp_name'], $url);

In Cakephp Config:

Configure::write('debug', 2);
Configure::write('log', E_ALL ^ E_NOTICE);

EDIT 2:

I did a scandir on $rel_url and it shows up the files just fine

[test2] => Array
    (
        [0] => .
        [1] => ..
        [2] => 1.jpg
        [3] => 10.jpg
        [4] => 16.jpg
        [5] => 2.jpg
        [6] => 2010-12-12-0142065.jpg
        [7] => 22.jpg
        [8] => 3.jpg
        [9] => 4.jpg
        [10] => 5.jpg
        [11] => 6.jpg
        [12] => 7.jpg
        [13] => 8.jpg
        [14] => 9.jpg
        [15] => error.png
    )

[debug] => Array
(
    [url] => img/recipes/555.jpg
    [rel_url] => img/recipes
)
  • 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-20T04:45:53+00:00Added an answer on May 20, 2026 at 4:45 am

    You say that there were updates in Subversion. I think that you did an svn checkout or svn update that messed up the permissions on the directory that you are trying to upload to. Check your permissions.

    BTW: move_uploaded_file() is a native PHP function. This has nothing to do with CakePHP.

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

Sidebar

Related Questions

i am using this code to upload files(images to a folder) <form action='' method='POST'
I am using the Uploadify Plugin to Upload files. although this might be a
I cant upload video files using this code for a form: <form action=upload.php method=post
I am using this function to upload my files: if ((($_FILES[Artwork][type] == image/gif) ||
I'm trying to upload a file to my server using the CakePHP file upload
I am using this form as a file upload form(as part of a larger
I need to upload a given image using Amazon S3 I have this PHP:
i am using uploadify script to upload files as my school project. //die($_SESSION['ID'].'.....'.$_SESSION['level']); if
I'm trying to upload files via Pycurl through POST, using a PHP script on
This code works properly in my localhost. I am using xampp 1.7.3. but when

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.