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

mainresponder.respond: Proposal or Callback?

Author:Kurt J. Egger
Posted:1/15/1999; 8:26:23 AM
Topic:mainresponder.respond: Proposal or Callback?
Msg #:2144
Prev/Next:2143 / 2145

I implemented http upload in mainresponder last night. I tried two options:

via callback

This script essentially parses the multipart-encoding into normal form-encoded postArgs. Then in respond it will be processed as normal POST request. The requestbody of multipart-encodings will be processed twice.

via respond

This script needs modification of mainresponder.respond. It is based on the parse.multipart script from Jeff Willden and needs a 4 line change in mainresponder.respond:

if string.lower (adrparamtable^.requestHeaders.["Content-type"]) beginsWith "multipart/form-data" { user.webserver.utilities.parseMultiPart2 (adrparamtable)} else { webserver.parseArgs (adrparamtable^.requestBody, adrtable); for i = 1 to sizeof (adrtable^) { adrtable^ [i] = string.urldecode (adrtable^ [i]); }}

I don´t want to change Userland shipped code and I assume that respond will be kernalized when frozen so we should dicuss this.



There are responses to this message:

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

© Copyright 1998-2001 UserLand Software, Inc.