This content has been marked as final. Show 6 replies
When you get the base64 value, you need to convert it into a blob.
There is a function in the APEX_WEB_SERVICE API that can do this, APEX_WEB_SERVICE.CLOBBASE642BLOB http://download.oracle.com/docs/cd/E17556_01/doc/apirefs.40/e15519/apex_web_service.htm#BABHIEJB
Couple of issues though - the Base64 value is likely larger than 32k, which APEX doesnt support submitting to the server, so you need to use AJAX to submit the value into a collection. Carl blogged about a way to do this: http://carlback.blogspot.com/2008/04/new-stuff-4-over-head-with-clob.html
Next issue, is the base64 string captured a canvas is in the format : data:image/png;base64,<base64> where image/png is the mime type. So when you convert the data to a blob, you don't wanna to pass the data:image/png;base64, into the function to convert. The way I did it was:
as the base64 string begins after the comma.
select substr(clob001, instr(clob001, ',')+1, length(clob001)) into l_clob from apex_collections where collection_name = c_collection_name;
(You probably also want to extract the mime_type using a similar technique)
so then you can call
Well that should be a good starting point for you.
l_blob := apex_web_service.CLOBBASE642BLOB(l_clob);