APEX 5文件浏览器apex_application_temp_files表为空

时间:2019-02-18 22:23:29

标签: oracle-apex oracle-apex-5 oracle-apex-5.1

当我在APEX 5上创建页面以上传文件时,apex_application_temp_files为空,这不允许我将文件插入自定义表。

我以此为密码

INSERT INTO custom_table(
     name,
     filename,
     mime_type,
     content,
     file_type,
     file_description,
     upload_by,
     upload_date)
     SELECT name, 
         filename,
         mime_type, 
         blob_content,
         :P1_FILETYPE,
         null,
         :APP_USER,
         sysdate
FROM apex_application_temp_files
WHERE 1=1
AND name = :P1_FILEBROWSER;

当我单击我的按钮时,表格没有值。单击按钮UPLOAD时,我正在执行动态操作的pl / sql代码。

我尝试这样做是为了查看动态操作是否有效,但是如果apex_application_temp_files表上没有任何内容,我不知道如何从文件浏览器获取文件名,mime类型和名称。

请参阅下面的代码,但无法获取名称,文件名和mime类型。

我该如何解决?

INSERT INTO custom_table(
     name,
     filename,
     mime_type,
     content,
     file_type,
     file_description,
     upload_by,
     upload_date)
     values ( 'name', 
     'filename',
     'mime',
     :P1_FILEBROWSER,
     :P1_FILETYPE,
         null,
         :APP_USER,
         sysdate
     );

1 个答案:

答案 0 :(得分:-1)

请尝试打击代码

  for i in 1 .. v_arr.count
loop
    :p1_id := st_id.nextval;
    insert into custom_table(
                             id,
                             name,
                             content,
                             filename,
                             mime_type, 
                             file_type,
                             file_description,
                             upload_by,
                             upload_date)
    values (:p1_id, 
            (select name from apex_application_temp_files where name = v_arr(i)),
            (select blob_content from apex_application_temp_files where name = v_arr(i)),
            (select filename from apex_application_temp_files where name = v_arr(i)),
            (select mime_type from apex_application_temp_files where name = v_arr(i)),
            null,
            null,
            null,
            null
            );
end loop;