0 Replies Latest reply: May 3, 2012 3:59 AM by 934740 RSS

    "Media Resource" template for downloading files

    934740
      Hi,

      I'd like to use a "media resource" template to download files stored in one of my tables. I have defined the following template:

      URI Template: attachment?id={id}
      Type: Media Resource
      Query: select mime_type, file_content from apex_rms.attachments where id = :id

      In my APEX application I have defined a link which points to the link defined by this resource template and everything's working fine, except for the target file where my browser wants to save this file. It's always "attachment" and that's pretty ugly. I have the filename in my table but I don't know how to pass it from the resource template to the browser. I guess it might have to deal with "Content-Disposition" header attribute but I'm not sure if there's any way to handle it within such a resource template.

      Any advice is highly appreciated!

      Thanks!