This portal is to open public enhancement requests against IBM Power Systems products, including IBM i. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).
We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:
Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,
Post an idea.
Get feedback from the IBM team and other customers to refine your idea.
Follow the idea through the IBM Ideas process.
Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.
IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.
ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.
Each of the QSYS2-based HTTP functions for get, put, post, patch, and delete now have a corresponding BLOB version.
You can read about them on a new fact page here:https://www.ibm.com/support/pages/node/6486889
And in IBM Documentation here: https://www.ibm.com/docs/en/i/7.5?topic=programming-http-functions-overview
Db2 for i development team
IBM Power Systems Development
The CEAC has reviewed this requirement and recommends that IBM view this as a HIGH priority requirement that is important to address.
Background: The COMMON Europe Advisory Council (CEAC) members have a broad range of experience in working with small and medium-sized IBM i customers. CEAC has a crucial role in working with IBM i development to help assess the value and impact of individual RFEs on the broader IBM i community and has therefore reviewed your RFE.
To find out how CEAC help to shape the future of IBM i, see CEAC @ ibm.biz/BdYSYj and the article "The Five Hottest IBM i RFEs Of The Quarter" at ibm.biz/BdYSZT
Sabine Jordan + Sara Anrdres – CEAC Program Manager, IBM
Hi
I think allowing BLOB's in the new http-functions from qsys2 is really a requirement.
When you are calling different (related) API's in 1 process and 1 of them returns a BLOB, than you need to use the old systools function for that 1 API call to make the process work. (or go back using systools for all the API calls.
Hi Pablo,
You are correct. Further research indicates this was just a short-coming in the new HTTP_GET UDTF. I believe IBM is planning to enhance it soon, but IDK for certain. :)
Hi BOB,
excuse me but I don't understand how can it be possibile with your technics.
Here's a sample with the different between http_get and HTTPGETBLOB.
the result of HTTP_get is:
// HTTPTransportException: Problem occurred when receiving the stream.
// No data available for message.
**FREE
// Elabora richiesta di chiamate http fatte da un programma esterno
Ctl-Opt DftActGrp(*no)
ActGrp(*StgMdl)
StgMdl(*SNGLVL)
Thread(*Concurrent)
Option(*NoUnRef :*SrcStmt :*NoDebugIo)
DatFmt(*Iso) TimFmt(*Iso)
Debug(*Constants)
AlwNull(*UsrCtl)
DftName(TESTCLOB)
Text('Elabora richiesta di chiamate http in batch');
// ___________________________________________________________________
Dcl-Pr TESTCLOB ExtPgm('TESTCLOB');
End-Pr TESTCLOB;
Dcl-Pi TESTCLOB;
End-Pi TESTCLOB;
// ____________________________________________________________________________
Dcl-S OutputClob SqlType(Clob_File) ccsid(1208);
Dcl-S OutputBlob SqlType(Blob_File);
Dcl-S HttpOptions VarChar(2000);
Dcl-S HttpHeader SqlType(Xml_Clob :10000) ccsid(1208);
Dcl-C SQLOK '00000';
Dcl-C SQLEOF '02000';
// Main Line
// ___________________________________________________________________
*Inlr = *On;
Exec Sql
Set Option Datfmt = *Iso,
Timfmt = *Iso,
Closqlcsr = *EndActGrp,
Commit = *chg;
HttpOptions = '{"connectTimeout":"5","redirect" : "10", "header":"content-type, accept, image/webpd"}';
OutputClob_Name = '/home/paolos/test.jpeg';
OutputClob_NL = %Len(%Trim(OutputClob_Name));
OutputClob_FO = SQFOVR; // OverWrite
Exec Sql
Values Qsys2.Http_Get('http://httpbin.org/image', :HttpOptions)
into :OutputClob;
If (SqlState = SQLOK);
Exec Sql Commit;
EndIf;
// the result of this is:
// HTTPTransportException: Problem occurred when receiving the stream.
// No data available for message.
OutputBlob_Name = '/home/paolos/testblob.jpeg';
OutputBlob_NL = %Len(%Trim(OutputBlob_Name));
OutputBlob_FO = SQFOVR; // OverWrite
HttpHeader_Data = '+
+
';
HttpHeader_Len = %len(%Trim(HttpHeader_Data));
Exec Sql
Values Systools.HttpGetBlob('http://httpbin.org/image', :HttpHeader)
into :OutputBlob;
If (SqlState = SQLOK);
Exec Sql Commit;
EndIf;
Return;
Hi IBM,
Why uncommited candidate?
IBM will use this request as input to planning but no commitment is made or implied. This request will be updated in the future if IBM implements it.
I reread my CGI BOUNDARY stuff in CGILIB and iQuery both of which support file uploads. I also read about CCSIDs and CLOB vs BLOB. Since a multipart form upload will be in USASCII for the header and boundary parts, it needs to be CLOB with a CCSID of 1208 (probably). Then once you get the boundary markers, you extract the content between the markers (that is your file data) which will be ASCII but "binary ASCII", and then save that out to the IFS, to a file with CCSID 1208.
If the result were a BLOB, then you'd have to move all that stuff to another CLOB and do some of that CCSID conversion (maybe via iconv if you're not using native SQL/PL) and then repeat the above. So again, unless I'm way off here, I don't think a BLOB is going to help you with file upload/transfers. May remembering/realizing that a CLOB is _NOT_ a null-terminated string would help visual it.
I could be wrong, but doesn't .ZIP and other binary uploads get converted to base64 when they're received? Thus, a BLOB won't really do you any good as nothing comes back through HTTP as a BLOB.
I know with POST method, you need to search for the BOUNDARY= marker and reconstruct the file upload from those marker boundaries. We us CLOBs for this today. But again, I could be off on this as I don't have the spec in front of me.