我在这里找到了方法,如何将剪贴板图像复制到一个区域,而且效果很好。但我没有找到如何将此图片保存到我的blob字段中。哪个变量包含图像(可能是javascript变量(,我如何在SQL表达式中引用它(例如在动态操作中(?
创建这样一个过程:
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;