How do I get the content to the AS/400 so that the web server can access and serve the documents? There are a number of ways to get the content from your PC to the AS/400 (assuming that you are creating your content on a PC and not directly on the AS/400). If you are creating your content directly on your AS/400 in a source physical file or physical file then this discussion is not necessary. We have found that most customers work on a client PC/MAC/Workstation to create the content and move the documents to the AS/400 when they are ready to be served.
The client work environment you are using you will have different options available to you. This section is not intended to be a comprehensive list of options available to you as a user. It is intended to help assist in finding a method and describe some of the steps and configuration necessary to transfer the data. FTP and Client Access are described in detail because they are likely to be available to most customers. If you have Client Access available, you should find it the easiest option.
The first thing that you need in order to use FTP is client FTP software. Secondly, your AS/400's FTP server software must be installed, configured and started. The FTP server is available as a free option of the operating system (TCP/IP Connectivity Utilities/400). The default configuration for the FTP server is a good configuration to use. Be aware of the fact that after the install of the TCP/IP Connectivity Utilities/400 all of the TCP/IP servers installed with this option are configured to start up automatically when TCP/IP is started on the AS/400 (STRTCP command). This is most likely not what you would expect nor want for your machine if it is connected to the Internet. You may want to use option 20 on the CFGTCP menu to disable the servers that you do not want started when TCP/IP is started. If you allow all applications to start and run constantly, you need to be aware of and evaluate the potential security risk involved. In order to start the FTP server independently of the STRTCP command you can use the STRTCPSVR SERVER(*FTP) command. The ENDTCPSVR SERVER(*FTP) command will end just the FTP server when you are done with it.
PUT example.htm examplelib/example examplembr
The example.htm file in the current directory on the client machine will be
transferred to the examplelib library within the
example file examplembr
member.
SITE NAMEFMT 1
The SITE command tells the client this is a site specific
command that needs to be sent to the server to be carried out. Some FTP
clients do not
support SITE; an alternative method will need to be entered
for these clients:
QUOTE "SITE NAMEFMT 1"
The quote command tells the client to send the quoted string to the server.
When the AS/400 server receives the quoted string SITE NAMEFMT 1 it will
change the naming format used and return a status message indicating that it
has done so. The NAMEFMT command sent without a value following
it will return
the current naming form as a status message.
Once you have changed the naming format to '1' then you can use the IFS file naming convention to access the QDLS file system (the entire IFS file system is available beginning with OS/400 V3R2). The previous PUT command example would work as follows using the naming format of '1':
PUT example.htm/QSYS.LIB/EXAMPLELIB.LIB/EXAMPLE.FILE/EXAMPLE.MBR
The example.htm file in the current directory on the client
machine will be
transferred to the examplelib library within the
example file examplembr
member.
The following example shows how to get to the QDLS file system using naming format '1'.
PUT example.htm /QDLS/example/example.htm
The example.htm file in the current directory on the client machine
will be
transferred to the example folder into the example.htm
PC file. This transfer
would NOT include any ASCII conversions. The code page assignment given to
the
file is the ASCII code page associated with the user profile signed on the
FTP client.
MPUT *.htm /QDLS/example/*.htm
All of the files in the current directory on the client machine which contain
the .htm extension would be transferred to the
example folder. These
transfers would NOT include any ASCII conversions. The code page assignments
given to the files are the ASCII code page associated with the user profile
signed on the FTP client. By default, the FTP client will prompt you before
transferring each file. you can change this with the PROMPT
command.
If your document root is in the root of IFS and you are transferring files to QDLS, you will need to transfer the files from the QDLS file system to the root file system. This can be done through use of the WRKLNK, CPY and MOVE commands available on the AS/400. The WRKLNK lists the files and directories one directory at a time. It also gives you the ability to select options (or commands) execute for the entities within the directory. The CPY command gives you the ability to copy files from one directory to another, or within the same directory with a different name. The MOVE command provides the ability to move a file or directory from one directory to another. The strength of the move command is that it works on directories and all sub-directories below the current. Note that both the CPY and MOVE commands fail when attempting to replace an existing file.
For more help on how to configure and use the FTP Clients and Servers on the AS/400 refer to the AS/400 TCP/IP Configuration and Reference (SC41-3420-02).
Client Access Version Order Number File System Access --------------------- ------------ ------------------ CA/400 for Dos Ext 5763XB1 QDLS only CA/400 for Windows 3.1 5763XC1 IFS root CA/400 for OS/2 5763XF1 QDLS only CA/400 for OS/2 optimized 5763XG1 IFS root
In addition to the above versions of CA/400, there is a beta version available at the time of this writing for Windows 95/Windows NT.
Both the QDLS connection and the IFS network drive connection give you the ability to copy the files directly on to the AS/400's disk. If you are using legacy clients and your web server's document root is within any file system other than QDLS you will need to copy or move the files to their appropriate locations using the WRKLNK, CPY or MOVE commands.
No data conversion takes place (EBCDIC/ASCII) during the transfer from the client machine to the AS/400 through either shared folders or the IFS network drive. However, a code page assignment will be given to the file. The Client Access product you are using decides the code page that will be assigned. Client Access for Windows 95/NT client will assign the code page value that your client machine is using. The other clients will make an assignment based on the single byte PC code page associated with AS/400 user profile used to sign onto the shared folder or IFS network drive.
The easiest and most secure way to determine what code page assignment was made is to check it using the display attributes option available on both the WRKLNK and DSPLNK commands. If the codepage assignment is not being made properly, you should override this value using the file CCSID value.
If you created the content under Windows this is a more difficult task. In most instances, Windows uses a different code page than DOS or any DOS session running within Windows. The CHCP command will only tell you what your DOS code page is not your Windows. The ANSI Code Page (ACP) is the code page value used for the Windows interface. If you are creating content with a Windows application your data will potentially have a different code page than if you created the data under DOS or OS/2. A different code page equates to potentially different code points for the same characters, which would produce unexpected results if not configured properly. All Client Access clients supporting a shared folder drive under Windows, except Client Access for Windows 95/NT, will most likely assign an incorrect code page to files copied to the AS/400 which were created by a Windows program. This problem can be corrected by configuring the File CCSID configuration value for a directory within the directory based configuration file. The following table should help assist in determining what CCSID value to assign.
CCSID Windows Operating System
----- ------------------------
1250 Eastern European
1251 Cyrillic
1252 US (ANSI)
1253 Greek
1254 Turkish
1255 Hebrew
1256 Arabic
874 Thai
932 Japan
936 Simplified Chinese (PRC, Singapore)
949 Korean
950 Chinese (Taiwan, Hong Kong)
Note: Windows NT (3.5 and beyond) support Unicode data files. It is
recommended that you save any HTML files using ANSI Code Pages instead of
the Unicode code page.