Using wwIPStuff and Multi-Part Forms for efficient binary tr |
Multi-Part form encoding uses a different approach that uses a header and several (multi-part) content blocks that contain the actual data. This data can be binary and in raw format and is not encoded before it is sent.
To use this mechanism with wwIPStuff you can use the nHTTPPostMode property and set it to a value of 2. The following example demonstrates:
On the client:
o=create('wwIPStuff')
o.nHTTPPostMode = 2
? o.HTTPConnect('localhost')
? o.AddPostKey('Filename','Test.prg')
? o.AddPostKey('File',File2Var('d:\utl\hex.exe'))
lcData = ''
lnSize = 0
? o.HTTPGetEx('/wc.wc?wwDemo~Test',@lcData, @lnSize)
ShowHTML( lcData)
On the Server:
Function Test
lcFileName = SYS(2035) + '\' + JUSTFNAMLE(Request.GetMultiPartFormVar('Filename'))
lcFileBin = Request.GetMultiPartFormVar('File')
*** WRite the file
File2Var(lcFileName,lcFileBin)
This.ErrorMsg('Complete',Filename)
RETURNThe file is returned as raw binary data on the server side and must be written to disk.
Last Updated: 08/17/99