Archive of UserLand's first discussion group, started October 5, 1998.

Re: mainresponder.respond: Proposal or Callback?

Author:Kurt J. Egger
Posted:1/15/1999; 9:56:02 AM
Topic:mainresponder.respond: Proposal or Callback?
Msg #:2156 (In response to 2154)
Prev/Next:2155 / 2157

The respond modification goes into mainresponder.respond where it parses the post args. The place of parseMultipart can be everywhere but I think if parsemultipart will be included in the standard release it should be in the mainresponder table.

Here is the code for mainresponder.respond:

"POST" {
	local (adrtable = @adrparamtable^.postArgs, i, paramTable);
	new (tabletype, adrtable);
	if string.lower (adrparamtable^.requestHeaders.["Content-type"]) beginsWith "multipart/form-data" {
		mainresponder.parseMultiPart (adrparamtable)}
	else {
		webserver.parseArgs (adrparamtable^.requestBody, adrtable);
		for i = 1 to sizeof (adrtable^) {
			adrtable^ [i] = string.urldecode (adrtable^ [i]);
			}};
	«local (adrtable = @adrparamtable^.postArgs, i, paramTable)
	«new (tabletype, adrtable)
	«webserver.parseArgs (adrparamtable^.requestBody, adrtable)
	«for i = 1 to sizeof (adrtable^)
		«adrtable^ [i] = string.urldecode (adrtable^ [i])
		«
	}

mainresponder.parseMultipart can be found at: http://bjckm.egger-lerch.at/parsemultipart.html

Any optimization of the code is welcome.

Thanks for listening

Kurt


There are responses to this message:


This page was archived on 6/13/2001; 4:47:18 PM.

© Copyright 1998-2001 UserLand Software, Inc.