Forum Stats

  • 3,817,330 Users
  • 2,259,314 Discussions
  • 7,893,751 Comments

Discussions

download an images from apex without extension

mkm802
mkm802 Member Posts: 30 Blue Ribbon

hello all

I stored images and pdf in blob column

when I tried to download them, the file downloaded without extension

.jpeg or .pdf

but when I add the extension, I can open the file

what I have to do to download the file with its extension

thanks

Tagged:

Answers

  • InoL
    InoL Member Posts: 9,817 Gold Crown

    when I tried to download them

    How exactly?

    If you use something like this to download the file:

    sys.htp.p('Content-Disposition: filename="' || p_file_name || '"');
    

    you need to code the full filename, with extension.

  • mkm802
    mkm802 Member Posts: 30 Blue Ribbon

    Dear Inol

    It is normal IR build on a table with blob column

    with this select statement

    select DOC_ID,DOC_DESC,sys.dbms_lob.getlength(DOC) DOC from DOCS order by doc_id

    the column Doc is a Download BLOB type in the IR and appear as a download link in the report

    when i run it and try to download the file ,

    it download without extension

    please

    see the photo attached

  • InoL
    InoL Member Posts: 9,817 Gold Crown
    edited Oct 4, 2020 4:08PM

    Basically it's the same: you have to provide a filename.

    A Download BLOB column has attribute "Filename Column" for that purpose. So, your table needs a column to store the full filename.

  • mkm802
    mkm802 Member Posts: 30 Blue Ribbon