On Apex 4.2.2 (upgrade not possible at the moment) I am experiencing this intermittent error when uploading a CLOB via a DA:
XMLHttpRequest: Network Error 0x2f7d, Could not complete the operation due to error 00002f7d.
I am grabbing a photo from a digital camera using a third party application. This is done via a ActiveX and a dll on the local PC (so yes, this only runs in IE, and we use https for the site).
// Grab the photo from the camera. captureAndPrint talks to the dll on the local PC to get the base64 image
var result = captureAndPrint.image(destination, scriptName, width, height);
if (result != 0) {
var img = document.getElementById('capturePhotoOutput');
img.onload = function() {
resizeAndSave(this, 600, 600 * aspectRatio);
};
img.src = 'data:image/jpeg;base64,' + result;
So far so good.
In the onload function I am resizing the image and upload the image in parts in the f01 array (so, not using the CLOB_CONTENT collection method, but I also tried that method)
function clob2array(clob, size, array) {
loopcount = math.floor(clob.length / size) + 1;
for (var i = 0; i < loopcount; i++) {
array.push(clob.slice(size * i, size * (i + 1)));
}
return array;
};
function resizeAndSave(img, width, height) {
// do some resizing using a vcanvas first
var f01array = [];
f01array = clob2array(base64image, 30000, f01array);
apex.server.process('saveImage', {
f01: f01array,
x01: 'P'
}, {
datatype: 'text',
success: function(pdata) {
if (pdata != '') {
alert('Save to database error: ' + pdata);
}
}
});
}
The saveImage PL/SQL process retrieves the chunks from the f01 array:
dbms_lob.createtemporary(l_clob,
false,
dbms_lob.session);
for i in 1 .. apex_application.g_f01.count
loop
l_chunk := wwv_flow.g_f01(i);
if length(l_chunk) > 0 then
dbms_lob.writeappend(l_clob,
length(l_chunk),
l_chunk);
end if;
end loop;
-- and for the rest I use l_clob to insert or update a value in the database.
I can grab 2-3 photos before I get the XMLHttpRequest error.
After that I wait 3 minutes, and I can grab a few photos again.
I did a lot of debugging in my own code, but I can't do much about apex.server.process (the asynchronous call that seems to cause the error).
Since the error disappears when I wait a few minutes, it seems like something in the apex.server.process is "hanging" preventing another call.
Does anyone have any idea where to look?
Thanks a lot for any pointers.
Ino