我正在尝试将文档从 APEX 页面上传到 S3 存储桶,并且在https://www.apexutil.com/ords/prod/f?p=700:200:1349309139567 :::的插件的帮助下成功了::
该插件演示了检索上传结果并插入到表中,如下所述。
Create new dynamic action;
Choose Upload Success [FM Component];
Choose "Execute JavaScript Code" action;
Inside the "Code" textarea define code:
apex.server.process("my_ajax_process", {
x01: this.browserEvent.originalEvent.detail.serverId,
x02: this.browserEvent.originalEvent.detail.file.name,
x03: this.browserEvent.originalEvent.detail.file.body.size,
x04: this.browserEvent.originalEvent.detail.file.body.type
}, {
success: function() {
console.log("success");
},
并在 Ajax 进程中检索 x0 值并插入到表中。
Create Ajax Process, name: "my_ajax_process"
Define PL/SQL code:
declare
l_server_id varchar2(4000) := apex_application.g_x01;
l_name varchar2(4000) := apex_application.g_x02;
l_size number := apex_application.g_x03;
l_type varchar2(4000) := apex_application.g_x04;
begin
insert into MY_TABLE (MT_SERVER_ID, MT_NAME, MT_SIZE, MT_TYPE)
values (l_server_id, l_name, l_size, l_type);
owa_util.status_line(nstatus => 204, creason => 'No Content');
end;
但是,我需要在 Ajax 进程中捕获 X0 值并将其分配给表单页面项,因为我必须将输出与其他表单字段一起存储并存储到我的表中。我已经尝试过,但它没有得到更新。非常感谢任何帮助
declare
l_server_id varchar2(4000) := apex_application.g_x01;
l_name varchar2(4000) := apex_application.g_x02;
l_size number := apex_application.g_x03;
l_type varchar2(4000) := apex_application.g_x04;
begin
:P12_DOCUMENTURL := l_server_id;
:P12_DOCUMENTTYPE := l_type;
:P12_DOCSIZE := l_size;
owa_util.status_line(nstatus => 204, creason => 'No Content');
end;