• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BLOBs - not possible to add filename/metadata?
#1
Hi Mark and Team
I was wondering if I could have some guidance on to how to use the BLOBs function.

I can upload all the BLOBs I want - but the database does not seem contain any reference to the file name or allow embedding any metadata relating what the BLOB is.  So all I can access is a bunch of BLOBs with a cdbRecordID and type, but nothing else, which means there is no way to search for the BLOBs that are relevant to a particular operation.

In my specific use case, I want to upload 10 medical cases that contain 10 videos each. No problem at all uploading them all as BLOBs (as a sidenote, the upload seems to be deferred to the background as a non-blocking action, is there a callback option to notify completion?).
The question is: How am I meant to know which BLOB is which video? The only way I can see is to keep a separate database linking the cdbRecordID to a specific case, which introduces an unnecessary level of complexity. The key HBID seems pointless as it only contains boilerplate text. 

I would have thought that since the file name is passed as part of the create blob process this should be a key in the cdbBlobs table... or am I missing something?
How is this envisioned to be used in cases where batch uploads are performed as a standalone step?

Seems likely I'm missing something, so really grateful for guidance on this
Many thanks
Stam
  Reply
#2
Hi Stam,

Great questions.

Quote:The question is: How am I meant to know which BLOB is which video? The only way I can see is to keep a separate database linking the cdbRecordID to a specific case, which introduces an unnecessary level of complexity.

We do this in one of our apps made in Appli. This app has themes. We use the blobs table and a themes table. First we create the blob in the blobs table.  Next we take the blob cdbRecordID and use it as a linking key when we create the theme record in the themes table. The theme record has data about the theme including the name.

If you would like to avoid using another table with a linking key, you can add keys to the blobs table. After you create a blob, you can use cdb_update to populate the keys you added to the blobs table with more information about the blob. The same can be done with cdb_batchUpdate if you are batch uploading.

Quote:(as a sidenote, the upload seems to be deferred to the background as a non-blocking action, is there a callback option to notify completion?)

The upload should be blocking. Creating blobs will populate the output variable with the cdbRecordIDs of the new blobs after completion.

- Efrain
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)