This public source tool allows to upload / download via HTTP IFS stream files to / from
an iSeries server.
- Updates to this package are documented on
- To find out the release date of a FUPLOAD package installed on your IBM i,
run command FUPLOAD/RELEASED .
Download it from the Easy400 site. Registration is required.
- OS/400 V5R2 or subsequent
- Library QHTTPSVR (product 5722DG1)
- RPG-ILE compiler (just for the installation)
- unzip the fupload.zip file you have downloaded.
It contains a readme.txt instructions file and file
- crtsavf qgpl/fupload
- use FTP to load PC file fupload.savf
into save file qgpl/fupload
- rstlib fupload *savf savf(qgpl/fupload)
- to complete the installation, run the following
strrexprc srcmbr(install) srcfile(fupload/qrexsrc)
This procedures performs the following
- compiles modules, creates programs
- restores directory /fupload
- displays the stream file /fupload/conf/httpd.conf
containing the directives for an HTTP instance able to run this tool.
To install the HTTP instance, run command
cpyf fromfile(fupload/qatmhinstc) tofile(qusrsys/qatmhinstc)
- To start the HTTP instance
strtcpsvr server(*http) httpsvr(fuploadapa)
3. Running the utilities
- To run the File Upload utilities, see this page.
- To run the File Download utility, see this page.
Most likely you will need to protect your file upload / download
service, in such a way that only authorized users may access it.
We have already provided for some basic protection,
based on the validation list "FUPLOADDT/FUPLOAD".
Should you feel unconfortable with validation lists
for protecting sensitive programs, may we recommend that you take a look at
a very popular Easy400 delivery: Work with Validation Lists.
Here is how you can easily take advantage of the existing
protection set up:
- run command
CHGSYSVAL SYSVAL(QRETSVRSEC) VALUE('1')
- create the following user profile:
crtusrprf usrprf(fupload) inlmnu(*signoff)
text('To implement file upload protection') aut(*use)
- enable HTTP protection directives:
- uncomment the following HTTP directives in the IFS stream file /fupload/conf/httpd.conf :
# AuthType Basic
# AuthName FILE_UPLOAD
# PasswdFile FUPLOADDT/FUPLOAD
# UserID FUPLOAD
# Require valid-user
- STRTCPSVR SERVER(*HTTP) RESTART(*HTTP) HTTPSVR(FUPLOADAPA)
- Validation list FUPLOADDT/FUPLOAD is delivered
with a single entry:
You may want to take advantage of this
to test our basic protection.
- use command "fupload/wrkvldle"
to maintain the validation list
This command also maintains database file
that can be used for a local customized version of an upload program.
Wrk with a vldl entry (WRKVLDLE)
Type choices, press Enter.
action . . . . . . . . . . . . . *ADD, *CHG, *RMV
user name for logon . . . . . .
password for logon . . . . . . .
'user full name' . . . . . . . .
validation list . . . . . . . . FUPLOAD Name
library . . . . . . . . . . . FUPLOADDT Name, *LIBL, *CURLIB
- If you want to create a customized tool for maintaining
- review ILE-RPG module
- note that program
retrieves the logged-in user name in variable
can be added a routine to make sure that the logged-in user ("UserName")
is authorized to the IFS target
directory (variable "ServerDir")
5. HTTP access to the uploaded files
If you want to enable the HTTP access to the uploaded files
(as an example, the files in the IFS directory /sales/2012)
- grant *public authority for the objects, like
CHGAUT OBJ('/sales') USER(*PUBLIC) DTAAUT(*RX)
CHGAUT OBJ('/sales/2012') USER(*PUBLIC) DTAAUT(*RX)
CHGAUT OBJ('/sales/2012/*') USER(*PUBLIC) DTAAUT(*RX)
- provide some HTTP directives to the configuration file of the HTTP instance.
The following example shows how to enable access to the files uploaded to IFS directory
If you also want to restrict the access to the only people authorized to upload PC files, use the following HTTP directives instead:
Alias /sales/ /sales/
allow from all
Alias /sales/ /sales/