I found the way here, how to copy a clipboard image to a region, ad it works well. But I didn't find how can I save this picture into my blob field. Which variable contains the image (maybe it is a javascript variable), and how can I refer to it in the SQL expression (e.g. in a dynamic action)?
Asked
Active
Viewed 644 times
1 Answers
0
create a process like this:
declare
doc_size integer;
Upload_blob blob;
begin
--Copy BLOB to Upload_blob variable
select blob_content into Upload_blob from APEX_APPLICATION_TEMP_FILES where name = :FILE_BROWSER;
--Get BLOB size
doc_size := dbms_lob.getlength(Upload_blob);
--Copy data to table MyIMAGES_TBL
if doc_size <= 1000000 then
insert into MyIMAGES_TBL ( IMAGE_NAME, FILENAME, MIME_TYPE, DOC_SIZE, CONTENT ) select :FILE_NAME, filename, mime_type, doc_size, blob_content from APEX_APPLICATION_TEMP_FILES where name = :FILE_BROWSER;
--Delete temp files delete from APEX_APPLICATION_TEMP_FILES where name = :FILE_BROWSER;
else delete from APEX_APPLICATION_TEMP_FILES where name = :FILE_BROWSER;
commit;
raise_application_error(-20001,'Cannot upload pictures bigger than 1MB!');
end if;
exception when others then raise_application_error(-20001,'Error when uploading image!');
end;

Amir Solati
- 41
- 1
- 4