This post is part of the Getting Started with Plug-ins Pro APEX plug-ins series.
In many Oracle Application Express projects, there's a requirement that people can upload files. Typically the end-users want the ability to drag-and-drop images, PDFs, or other file types in their application.
For example, if you use APEX Office Print, you might have added in your application the ability for end-users to upload their own templates which typically are docx, xlsx, pptx, html and text files.
Those files are then stored in the database in a BLOB column or they might be stored on a file server or cloud storage.
In order to add this capability in your app, APEX provides a File Browse item.
But be careful with the accepted File Types feature. You can define image/* if you want your browser to only allow selecting of images. BUT specifying the file type doesn't prevent users from dragging-and-dropping other file types! So you can't rely on this feature to keep other file types out of your database.
In most of the projects I'm involved in, the end-users want more than the standard HTML File Browse that Oracle APEX provides out-of-the-box.
The most requested features are:
- Show which files were selected when adding multiple files
- A visual indicator of the progress of uploading
- Save files directly to the cloud (Oracle Cloud Object Storage, Amazon S3) instead of the database
- Limit the file types that will be accepted
- Only allow files with a size less than x MB
- Specific to upload of images: resize and compress images and add watermarks automatically
- Rename files