• Resolved ricbax

    (@ricbax)


    I am getting the infamous “The uploaded file could not be moved to (path to uploads goes here)

    I have added the following php function to the class-wp-upgrader.php to get the output that is getting generated.

    print_r($_FILES);

    //Handle a newly uploaded file, Else assume its already been uploaded
                    if ( !empty($_FILES) ) {
                            $this->filename = wp_unique_filename( $uploads['basedir'], $this->filename );
                            $this->package = $uploads['basedir'] . '/' . $this->filename;
      here ----- >   print_r($_FILES);
                            // Move the file to the uploads dir
                            if ( false === @ move_uploaded_file( $_FILES[$form]['tmp_name'], $this->package) )
                            wp_die( sprintf( __('The uploaded file could not be moved to %s.' ), $uploads['path']));
                    } else {
                            $this->package = $uploads['basedir'] . '/' . $this->filename;
                    }

    This is the output I get when uploading a new plugin (Install Plugin):

    Array ( [pluginzip] => Array ( [name] => core-control.0.8.zip [type] => application/x-zip-compressed [tmp_name] => /tmp/phpTPbYjk [error] => 0 [size] => 167862 ) )

    Installing Plugin from uploaded file: core-control.0.8.zip
    Unpacking the package.
    Installing the plugin.
    Plugin Installed successfully.
    Actions: Activate Plugin | Return to Plugins page
    This is the output I get when uploading a new theme (Install Themes)

    Array ( [themezip] => Array ( [name] => typebased.zip [type] => [tmp_name] => [error] => 1 [size] => 0 ) )

    The uploaded file could not be moved to (path to uploads goes here) “

    I am positive it is not a permissions issue since plugins and themes both use the uploads folder. The $_FILES array is not getting populated during the upload process. I think there is a bug?

    -ricbax

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘The uploaded file could not be moved to … This is different then the others.’ is closed to new replies.