Home > other >  RESTful service - file name and extension in URL
RESTful service - file name and extension in URL

Time:10-25

I created RESTful service in Oracle apex to get BLOB - images from one table. Everything goes fine and when I browse my link I get a picture in my browser.

My link goes something like:

enter image description here

More details here.

The handler code -

ORDS.DEFINE_HANDLER(
      p_module_name    => '101',
      p_pattern        => 'files/:file_name',
      p_method         => 'GET',
      p_source_type    => 'resource/lob',
      p_items_per_page => 25,
      p_mimes_allowed  => NULL,
      p_comments       => NULL,
      p_source         => 
'select mime_type, the_file
from blobs
where FILE_NAME = :file_name');

Obviously the SQL needs updated to match your table & column definitions.

Disclaimer: I work for Oracle and am the product manager for ORDS.

  • Related