checkUploadedFile() public method

If we are on a server with open_basedir, we must move the file before opening it. The FAQ 1.11 explains how to create the "./tmp" directory - if needed
public checkUploadedFile ( ) : boolean
return boolean whether uploaded file is fine or not
Example #1
0
    }
    exit;
} else {
    if (isset($_POST['submit_get_json'])) {
        $settings = PMA_loadUserprefs();
        $response = PMA\libraries\Response::getInstance();
        $response->addJSON('prefs', json_encode($settings['config_data']));
        $response->addJSON('mtime', $settings['mtime']);
        exit;
    } else {
        if (isset($_POST['submit_import'])) {
            // load from JSON file
            $json = '';
            if (isset($_POST['import_type']) && $_POST['import_type'] == 'text_file' && isset($_FILES['import_file']) && $_FILES['import_file']['error'] == UPLOAD_ERR_OK && is_uploaded_file($_FILES['import_file']['tmp_name'])) {
                $import_handle = new File($_FILES['import_file']['tmp_name']);
                $import_handle->checkUploadedFile();
                if ($import_handle->isError()) {
                    $error = $import_handle->getError();
                } else {
                    // read JSON from uploaded file
                    $json = $import_handle->getRawContent();
                }
            } else {
                // read from POST value (json)
                $json = isset($_POST['json']) ? $_POST['json'] : null;
            }
            // hide header message
            $_SESSION['userprefs_autoload'] = true;
            $config = json_decode($json, true);
            $return_url = isset($_POST['return_url']) ? $_POST['return_url'] : null;
            if (!is_array($config)) {