public function extract($value)
    {
        if (!$value instanceof FileInterface) {
            return null;
        }
        
        // Store binary data in temporary file.
        $tmp = tempnam(sys_get_temp_dir(), 'yk-copy.');
        $out = fopen($tmp, 'w');
        $in  = $value->getResource();
        
        // ensures garbage removal
        register_shutdown_function(
            function ($filename) {
                @unlink($filename);
            },
            $tmp
        );
        
        while (!feof($in)) {
            fputs($out, fgets($in, 1024));
        }
        fclose($in);
        fclose($out);

        $return = ["file" => $tmp];

        foreach (['user', 'name', 'type'] as $key) {
            $v = $value->{"get$key"}();
            if ($v) {
                $return[$key]=$v;
            }
        }

        return $return;
    }