--TEST-- reading streams of various types with a base64 decoding filter on top of them. --SKIPIF-- --FILE-- $data)); } else { $insertQuery = $params['insertQuery']; $stmt = sqlsrv_query($conn, $insertQuery, array($data)); } if ($stmt) { do { $read = sqlsrv_send_stream_data($stmt); if ($read === false) { die(print_r(sqlsrv_errors(), true)); } } while ($read); fclose($data) || die(print_r(error_get_last(), true)); sqlsrv_free_stmt($stmt) || die(print_r(sqlsrv_errors(), true)); } else { die(print_r(sqlsrv_errors(), true)); } return fopen($params['testImageURL'], "rb"); } function prepareParams(&$arr, $fieldType) { if (isWindows()) { $phpgif = '\\php.gif'; } else { $phpgif = '/php.gif'; } $arr['tableName'] = $tblName = "B64TestTable"; $arr['columnName'] = $colName = "Base64Image"; $arr['fieldType'] = $fieldType; $arr['insertQuery'] = "INSERT INTO $tblName ($colName) VALUES (?)"; $arr['selectQuery'] = "SELECT TOP 1 $colName FROM $tblName"; $arr['testImageURL'] = dirname($_SERVER['PHP_SELF']) . $phpgif; // use this when no http access } ?> --EXPECT-- Test successful.