It sounds good to me as well. In our particular case I believe we still
need to modify the ITK shell though. We have three different types of
requests that may come in.
1. Normal A4D dynamic or static content request.
2. Request for very large file already sitting on a file server in the LAN.
3. Request for a file that needs to be created and may be of just about any
size.
To handle this currently we have modified the ITK shell as someone on this
list suggested (can't remember who sorry, but thanks again it has worked
wonderfully).
Here are the edits - in a nutshell.
`PM: A4D_ITK SLAVE
`Slave process that handles HTTP requests.
`A4D_ITK MASTER listens for connections and passes them here.
`Part of Active4D, the ultimate 4D web environment
`Adapted from ITK Acme demo, copyright Christian Quest
`Copyright � 2001 Aparajita Fishman, All Rights Reserved
READ ONLY(*)
MESSAGES OFF
C_LONGINT($streamRef)
ARRAY LONGINT(tableList_al;0)
Repeat
ITK_SendIPCMsg (2;String(Current process)) ` tell master that this slave
process is ready
PAUSE PROCESS(Current process)
$streamRef:=Num(ITK_RcvIPCMsg (1000+Current process)) `Receive the
streamRef on which we must handle the HTTP request
C_STRING(40;$requestType)
$requestType:=A4D_RequestTypeIsACGI ($streamRef)
Case of
: ($requestType="A4D")
A4D_ITK SERVER ($streamRef) `Handle the incoming HTTP request(s)
: ($requestType="File Download")
A4D_CGI SERVER ($streamRef) `Handle the incoming HTTP request(s)
: ($requestType="Dynamic File Download")
A4D_Dynamic File Download ($streamRef)
End case
ITK_SendIPCMsg (4;String($streamRef)) `Send the streamRef to the closer
to close the stream gracefully
WEB_UnloadRegisteredTables
Until (<>A4D_ExitingDB)
----------------------------------------------------------------------------
------
A4D_CGI Server and A4D_Dynamic File Download both are primarily to send
files to users. The Dynamic file download script will submit files to an
external application for processing and send the resultant files. The
'A4D_CGI Server' script will send a pre-existing file as-is to the client
browser. Both of these functions will load no more than 1 MB at a time for
transfer to keep memory requirements down. They also both contain logic for
attempting to ensure only a validated user is downloading files.