public function moveUploadedFile($localFile, $destination)
    {
        $dir = dirname($this->baseDirectory . $destination);
        if (file_exists($localFile) && $this->ensureDirectory($dir)) {
            /**
             * we could use is_uploaded_file() and move_uploaded_file()
             * but in case of ajax uploads that would fail
             */
            if (is_readable($localFile)) {
                // rename() would be good but this is better because $localFile may become 'unwritable'
                $result = copy($localFile, $this->baseDirectory . $destination);
                @unlink($localFile);
                return $result;
            }
        }
        return false;
    }
public function moveUploadedFile($localFile, $destination)
    {
        $dir = dirname($this->baseDirectory . $destination);
        if (file_exists($localFile) && $this->ensureDirectory($dir)) {
            /**
             * we could use is_uploaded_file() and move_uploaded_file()
             * but in case of ajax uploads that would fail
             */
            if (is_readable($localFile)) {
                // rename() would be good but this is better because $localFile may become 'unwritable'
                $result = copy($localFile, $this->baseDirectory . $destination);
                @unlink($localFile);
                return $result;
            }
        }
        return false;
    }
public function moveUploadedFile ( $ localFile , $ destination ) { $ dir = dirname ( $ this -> baseDirectory . $ destination ) ; if ( file_exists ( $ localFile ) && $ this -> ensureDirectory ( $ dir ) ) { /**
             * we could use is_uploaded_file() and move_uploaded_file()
             * but in case of ajax uploads that would fail
             */ if ( is_readable ( $ localFile ) ) { // rename() would be good but this is better because $localFile may become 'unwritable' $ result = copy ( $ localFile , $ this -> baseDirectory . $ destination ) ; @ unlink ( $ localFile ) ; return $ result ; } } return false ; }
Moves a temporary uploaded file to a destination in the container

@param  string $localFile   local path
@param  string $destination
@return bool
Moves a temporary uploaded file to a destination in the container