Wondering what the best practices might be dealing with BLOBs. From my ExtJS web application I want to store BLOBs and then retrieve them.
I'm using ExtJS on the front-end. I'm using a mixture of CGIDEV2, FUPLOAD and YAJL to deal with the back and forth.
I have the saving part working, although I'm not sure it's the optimal solution. I use Giovanni's FUPLOAD service program to store my image file in the IFS. I then run this code to convert the IFS image to a BLOB and store it in DB2:
At this point I can see my blob in the file. Next I need to retrieve it and send it back to my ExtJS front-end application. I'd like to retrieve it as just the base64 code, since that's how I need it to embed in a PDF.
This seems to give me "something". But not the long string of data I can see in the file.
Has anyone sent the BLOB string out in a web service? Do I need to use FDNLOAD instead?
Thanks in advance.
Mike
I'm using ExtJS on the front-end. I'm using a mixture of CGIDEV2, FUPLOAD and YAJL to deal with the back and forth.
I have the saving part working, although I'm not sure it's the optimal solution. I use Giovanni's FUPLOAD service program to store my image file in the IFS. I then run this code to convert the IFS image to a BLOB and store it in DB2:
Code:
d in s sqltype(blob_file) in_FO = SQFRD; in_NAME = infileName; in_NL = %len(%trimr(in_NAME)); tempKey = %trim(fileQuote#) + '_' + %trim(infileType); exec sql insert into mylibrary/myblobs values(:tempKey, :in) with nc ;
Code:
d out s sqltype(blob_file) d myBlob s sqltype(blob:1000000) out_FO = SQFOVR; out_NAME = infileName; out_NL = %len(%trimr(out_NAME)); exec sql select blob(mcdata) into :myBlob from mylibrary/iqblobs where mckey = :tempKey ;
Has anyone sent the BLOB string out in a web service? Do I need to use FDNLOAD instead?
Thanks in advance.
Mike
Comment