16.8.2.5.4.2 Serving Inline Temp Images for Preview

Serve staged upload images from APEX_APPLICATION_TEMP_FILES so they can appear in a preview grid.

As explained in Showing BLOB Images in Interactive Grid, to preview an uploaded image in the grid you need to reference it by URL in the src attribute of an HTML <img> tag. You can copy the inline image serving page from Serving Inline BLOB Images with a Page to make one with page id 9004 that serves an inline image from APEX_APPLICATION_TEMP_FILES table, based on its unique file name. The Pre-Rendering process calls the DOWNLOAD_UPLOADED_TEMPORARY_PHOTO procedure, passing in the unique uploaded file name to serve.

-- in package eba_demo_woodshr_file 
procedure download_uploaded_temporary_photo( 
    p_unique_filename in varchar2) 
is 
    l_file_blob apex_application_temp_files.blob_content%type; 
    l_mime_type varchar2(255); 
begin 
    select blob_content, mime_type 
      into l_file_blob, l_mime_type 
      from apex_application_temp_files 
     where name = p_unique_filename; 

apex_http.download ( 
    p_blob         => l_file_blob, 
    p_content_type => l_mime_type, 
    p_is_inline    => true ); 

end download_uploaded_temporary_photo;