Returns TRUE on success.
Returns FALSE on failure. Use pbms_errno() and pbms_error() to retrieve error details.
size_t file_callback(void *caller_data, char *buffer, size_t size, pbms_bool reset) { int *fh = (int*) caller_data; if (reset) { lseek(fh, 0, SEEK_SET); } if (size) { size = read(fh, buffer, size); } return size; } main () { PBMS pbms; int fh; char blob_ref[MS_BLOB_URL_SIZE]; pbms_library_init(false); pbms = pbms_connect("localhost", 8080, "test"); // Send a file using a callback: fh = open("myblob.jpg", O_RDONLY, 0000777); size = lseek(fh, 0, SEEK_END); lseek(fh, 0, SEEK_SET); pbms_put_data_cb(pbms, NULL, blob_ref, size, file_callback, &fh); printf("Blob reference = \"%s\"\n", (char *) &blob_ref); close(fh); pbms_close(pbms); pbms_library_end(); }