Microweber\Utils\Import::move_uploaded_file_to_import PHP Method

move_uploaded_file_to_import() public method

public move_uploaded_file_to_import ( $params )
    public function move_uploaded_file_to_import($params)
    {
        only_admin_access();
        if (!isset($params['src'])) {
            return array('error' => 'You have not provided src to the file.');
        }
        $check = url2dir(trim($params['src']));
        $here = $this->get_import_location();
        if (is_file($check)) {
            $fn = basename($check);
            if (copy($check, $here . $fn)) {
                @unlink($check);
                return array('success' => "{$fn} was moved!");
            } else {
                return array('error' => 'Error moving uploaded file!');
            }
        } else {
            return array('error' => 'Uploaded file is not found!');
        }
    }