pbms_put_data
Description
pbms_bool pbms_put_data ( PBMS pbms ,const char * table ,char * ref ,size_t size ,const unsigned char * buffer )
Sends buffered data to the PBMS BLOB streaming daemon returning a BLOB reference. The BLOB reference can then be inserted into a longblob column of a PBMS enabled table inplace of the actual BLOB data.
Parameters
pbms
A valid PBMS connection handle.
table
The table into which the blob reference will eventually be inserted. If not supplied no table will be associated with the new BLOB until the reference is inserted into a table. Providing the table name here make the BLOB handling on the daemon a bit more efficient.
ref
A pointer to a BLOB reference buffer into which the BLOB reference will be place on successful completion of the function call. The buffer must be atleast MS_BLOB_URL_SIZE bytes.
size
The total size, in bytes, of the data in the buffer to be sent.
buffer
The BLOB data to be sent to the PBMS daemon.
Return Values

Returns TRUE on success.

Returns FALSE on failure. Use pbms_errno() and pbms_error() to retrieve error details.

Example
	PBMS pbms;
	char blob_ref[MS_BLOB_URL_SIZE], query[MS_BLOB_URL_SIZE + 100];
	const char *a_blob = "A tiny BLOB";
	
	pbms = pbms_connect("localhost", 8080, "A_database");

	//-----------
	// Create a BLOB and insert it into a table.
	// Assume that the table exists.
	pbms_put_data(pbms, "bobtest", blob_ref, strlen(a_blob), a_blob);
	
	snprintf(query, MS_BLOB_URL_SIZE + 100, 
	"insert into bobtest(id, name) Values(1, \"%s\")", blob_ref);
	mysql_query(mysql, query); // Assume we have a MySQL connection.
	

	pbms_close(pbms);
		
Related functions
pbms_put_data_cb() pbms_get_data() pbms_get_data_cb()