Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Send BLOB from browser to APEX using AJAX

Scott WesleySep 19 2013 — edited Sep 27 2013

Hi,

I'm trying to upload multiple files using drag/drop. I think I have most of the infrastructure prepared, but I'm falling over at a certain point.

I'm using the following jQuery library for the file upload

https://github.com/blueimp/jQuery-File-Upload/wiki

And I'm hijacking the submit callback to call some APEX related stuff, using the concept @"MartinGiffyD" describes here.

Martin Giffy D'Souza on Oracle APEX: How to Send/Upload a CLOB from the Browser to APEX via AJAX

The part I'm strugging with is identifying the file data component from the blueimp library.

I've got the file name, file type, but the data either fails with

Object #<File> has no method 'substr'

or loads junk into the collection (before and after base64 conversion) - regardless of file type.

My callback is

submit: function (e, data) {loadFile(data); return false;}

function loadFile(data){

$.each(data.files, function (index, file) {

// ...

// htmldb_Get etc .

// ...

clobObj._set(file); // or variation, eg: clobObj._set(data) when not using $.each

Note the collection populates successfully if I just hardcode some text in the clobObj call.

I'd be happy with a reference to a working model sending BLOB to collection, without the blueimp library overhead.

Cheers.

Scott.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 25 2013
Added on Sep 19 2013
11 comments
5,231 views