..the apex plugin directory

an initiative of

Add your APEX Plugin info

Describe your Plugin’s features. You can upload the Plugin’s code and documentation, or, alternatively, submit the URLs to your Website, GitHup Repository or Blog.

You are here:
Follow us on Twitter
Process Type Plugin SaveFilesToDisk


Categories: Process Type Plugin
Author: MirMas

Saves files uploaded with file browse item to disk


First your DBA should grant:
grant EXECUTE on "SYS"."UTL_FILE" to <schema>;
grant EXECUTE on "SYS"."DBMS_CRYPTO" to <schema>;
Next you need to create SaveToDisk and optionally SaveToDiskWithLog function (*.fnc create scripts) to some schema available to APEX workspace. Most usually this would-be APEX parsing schema.
We reference this schema as <schema>.
Prerequisite for creating SaveToDiskWithLog is installed Logger (https://github.com/OraOpenSource/Logger) on <schema>.

Import plugin to your app. Execution Function Name is by default #OWNER#.SaveToDisk. If <schema> is not APEX parsing schema change it to <schema>.SaveToDisk.
If you want to use extensive login with Logger (https://github.com/OraOpenSource/Logger) change it to #OWNER#.SaveToDiskWithLog or <schema>.SaveToDiskWithLog.


Create File Browse page item on APEX app page and choose APEX_APPLICATION_TEMP_FILES for storage.
Create page process of type plugin.
Choose process Point: On Submit - After Computations and Validations (default)

File Browse Item: Name of File Browse item (e.g. P1_UPLOAD) which holds filenames of uploaded files. Storage must be APEX_APPLICATION_TEMP_FILES table.
Plugin move files from APEX_APPLICATION_TEMP_FILES table to server disk.

Destination Linebreak: Line break in text files after text move. Can be CR LF (Windows) or LF (Linux, MAC)

Max Filesize: Maximum allowed size in bytes. Abbreviations K,KB,M,MB,G,GB are allowed.
Examples of valid formats: 100000, 150 K, 3,76 M, 1,5 GB, 1.5G.

Move format:
database directory#source filename#regexp_pattern#regexp_replace#Overwrite old file(Y/N)#Binary or text move(B/T)#Charset#plsql block
database directory#source filename#regexp_pattern#regexp_replace#Overwrite old file(Y/N)#Binary or text move(B/T)#Charset#plsql block
User <schema> needs read, write privileges on each database directory. (e.g. grant READ, WRITE on directory "DIR" to <schema>);
See Move format plugin attribute help or move_format_help.md for more info. You can reach this file from "Other Useful Info link.

Item with Filenames: Select page item which will save filename(s) of uploaded file(s) separated with colon.
Usually you want to use this item value in process after SaveToDisk process.

Item with Hash values: Select page item to store Hash value(s) of type RAW separated with colon. This is useful when you want to track file(s) changes.

Text area item with log: Select item which will hold plugin log. Display Only or read only Text Area is usual choice.
It's highly recommended to display plugin log if you have multiple files and/or complex move format.

Conditions: Select Condition Type "Value of Item/Column in Expression Is NOT NULL" and for Expression1
set the same File Browse item you set at Plug-in settings (e.g. P1_UPLOAD). This step is optional.

For the rest you can left defaults.


Install sample application fSampleApp.sql, change SaveToDiskMulti plugin process attribute "Move Format" to suit your configuration.
You can change also "Destination Linebreak" and "Max Filesize" attributes.
Similarly change SaveToDisk plugin process attribute Database directory and possibly "Filename" and "Max Filesize".


Special Requirements
You need APEX 5.1 with multiple upload File Browse item.
Schema where you install SaveToDisk function must have grants to execute UTL_FILE and DBMS_CRYPTO packages. It needs read write access to at least one Oracle directory.

Save file,server disk,APEX_APPLICATION_TEMP_FILES,file browse

Company: Mirmas
Date added: 21.11.2017
Views: 1299
Votes: 1
Reviews: 0
Min. APEX Version:
Share on Facebook
Digg! Share on Digg
Save This Page
download apex plugin
If something is not correct please report it here: Report Listing
Do you have a question about this Plugin? Want to write a Review or Comment?
Login first.
Reviews / Questions / Comments are e-mailed to the author of the Plug-in.
Powered by Sigsiu.NET RSS Feeds

Disclaimer: The APEX Plugins on this site are not supported by Oracle Support Services.

If you have a question about a Plugin or need support: Login and select the plugin detail page. At the bottom you can enter your Question / Review / Remark.
Your message will be sent to the author of the plugin.