This site is currently read-only as we are migrating to Oracle Forums for an improved community experience. You will not be able to initiate activity until January 30th, when you will be able to use this site as normal.

    Forum Stats

  • 3,889,924 Users
  • 2,269,775 Discussions
  • 7,916,823 Comments

Discussions

Oracle Rest + Oracle Apex 5, not displaying images on reports.

Igor Sala
Igor Sala Member Posts: 34 Blue Ribbon
edited Jun 10, 2016 2:41PM in APEX Discussions

Hello folks!

I'm using Oracle Apex + Oracle Rest Data Service and trying to display employee's photo in a report, but an error occurred:

note: Directly on Apex, without pass trough the Rest, works fine. 

Image_error3.JPG

Image_error1.JPG

500 Internal Server Error

  • An unexpected error with the following message occurred: .jpg; charset=utf-8



The query:


SELECT dbms_lob.getlength(photo) Photo

   FROM fotos


And Oracle Apex is using apex_util.get_blob to try display image.


Thanks for helping!



Tagged:
Igor SalaBharat G

Best Answer

  • Igor Sala
    Igor Sala Member Posts: 34 Blue Ribbon
    edited Jun 10, 2016 2:41PM Answer ✓

    Hey folks, I did it!

    My table Photos contains the following columns: Code number(6), Filename varchar2(100), Type varchar2(20), Photo Blob, Charset varchar2(20).

    Directly on Apex, the column Type was '.jpg' and works fine.

    When I use ORDS, Type column must be 'image/jpg', then works.

    Thank you.

    Igor Sala

Answers

  • Bharat G
    Bharat G VijayawadaMember Posts: 490 Bronze Badge
    edited Jun 10, 2016 1:49AM

    Error message looks like Charset is missing. Do you have Charset field in the table and attached in the APEX Blob Attributes to its corresponding field ?


    Regards,

    Bharat

    Igor SalaIgor Sala
  • Igor Sala
    Igor Sala Member Posts: 34 Blue Ribbon
    edited Jun 10, 2016 9:09AM

    Yes, I did it, but no success. As I said before, the curious thing is that works directly on Apex, the image displays, but only when I'm not accessing by Oracle Rest.

    Thank you for your attention, Bharat.

    Bharat G
  • Igor Sala
    Igor Sala Member Posts: 34 Blue Ribbon
    edited Jun 10, 2016 2:41PM Answer ✓

    Hey folks, I did it!

    My table Photos contains the following columns: Code number(6), Filename varchar2(100), Type varchar2(20), Photo Blob, Charset varchar2(20).

    Directly on Apex, the column Type was '.jpg' and works fine.

    When I use ORDS, Type column must be 'image/jpg', then works.

    Thank you.

    Igor Sala
This discussion has been closed.