Upload and download files from ADF into blob type colum.
From time to time on OTN Forum appears problem how to upload any file to Oracle database, and then download it from ADF Faces application. Because I also met this problem, bellow present it's solution. Example uses popup window to uploading, but it can be created on separate page.
To run example you must create in any schema table, sequence and trigger (all contained in create.sql script). Look into MimeTypes class. It conatins getMimeType() method that gets file extension and return suitable mime type.
Some people on OTN Forum get exceptions because they tried to make operations on files not supported by this method .
Download example (JDeveloper 10.1.3.2). Before running copy from JDeveloper to public_html /WEB_INF/lib libraries: adf-faces-impl.jar
i jsf-impl.jar.
|