Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] retrieve-user-data needs help

From: ryan::christiansen::intellisol::com at: 2-May-2001 17:15

I'm trying to incorporate my 'decode-multipart/form-data function into the commonly used 'retrieve-user-data function, but I am getting something wrong. The function works now for GET operations but not for POST. If I use 'read-io on system/ports/input, that clears the port, correct? Then... return make object! decode-cgi input ...will no longer work. But if I replace that line with... return make object! decode-cgi post-data ...thus using the data I have already retrieved, (using 'post-data in my function below instead of 'input) the function does not work. Why? 'decode-cgi requres an argument of 'any-string! and should be able to handle my 'post-data argument, shouldn't it? Here is the version of 'retrieve-user-data I am trying to use... retrieve-user-data: func [][ either system/options/cgi/request-method = "POST" [ content-length: 20 + load system/options/cgi/content-length post-data: make string! content-length read-io system/ports/input post-data content-length parse/all post-data [thru "Content-Disposition: " copy text to ";" (post-type: copy text)] switch/default post-type [ "form-data" [ decode-multipart/form-data ] return make object! decode-cgi input ] ][ return make object! decode-cgi system/options/cgi/query-string ] ] Ryan C. Christiansen Web Developer Intellisol International 4733 Amber Valley Parkway Fargo, ND 58104 701-235-3390 ext. 6671 FAX: 701-235-9940 Global Leader in People Performance Software _____________________________________ Confidentiality Notice This message may contain privileged and confidential information. If you think, for any reason, that this message may have been addressed to you in error, you must not disseminate, copy or take any action in reliance on it, and we would ask you to notify us immediately by return email to [ryan--christiansen--intellisol--com]