The file upload function transfers client-side-generated data (files) to the WWW Server.
This function is valid in the following cases:
When a large amount of data that may cause timer expiration in online processing is to be entered.
When a mobile environment with meter-rate accounting is to be used.
When a data entry tool is already prepared at the client side and WWW Server linkage using the tool output data (files) is requested instead of a request to change the data entry tool into a Web tool.
When only the HTTP ports can be accessed in file transfer because of security conditions. (File transfer in conventional systems is done using FTP.)
Using the file upload function, file transfer can be associated with applications. Therefore, data can be checked and registered immediately after file transfer.
The following conceptual chart of processing which uses the file upload function is shown below:
Web subroutines provide the following functions to easily create such application programs:
Function | Subroutine name | Usage |
---|---|---|
File upload | COBW3_GET_UPLOADFILE_INFO COBW3_GET_UPLOADFILE_INFO_X COBW3_GET_UPLOADFILE_INFO_N | Acquires the information on an upload file. |
COBW3_GEN_UPLOADFILE COBW3_GEN_UPLOADFILE_X COBW3_GEN_UPLOADFILE_N | Generates an uploaded file on the WWW Server. | |
COBW3_DEL_UPLOADEDFILE | Deletes an uploaded file. |
To upload a file, the following values must be written on the Web page for invoking an application:
Tag name | Attributes | Value |
---|---|---|
FORM | METHOD | POST |
ENCTYPE | multipart/form-data | |
INPUT | TYPE | file |
For details of these tags and attributes, see the "NetCOBOL Web Guide" and other documentation resources that explain HTML.
The above tags can be used together with the INPUT tag of other types (that is, other than "file") in the same FORM. The data that corresponds to these INPUT tags can be acquired by a subroutine such as COBW3_GET_VALUE regardless of whether the file upload function is used.
Note
In this Web subroutines, size of the uploaded files should be 999,999,999 bytes or less. Even if it is a file of 999,999,999 bytes, data cannot occasionally be received according to WWW Server.
The NAME value specified in the INPUT tag (TYPE="file") for uploading files cannot be used in the INPUT tag of other types (that is, other than "file"). Otherwise, the normal operation of the Web subroutine is not assured.
Example
: <INPUT TYPE="text" NAME="FILE1"> <INPUT TYPE="file" NAME="FILE1"> ß Do not specify :