3 problems using CGI in Euphoria
- Posted by Nemo <now at vi?.163.com> Jan 13, 2008
- 563 views
Hi everyone. I encountered a few problems when using CGI. Can someone kindly help? Environment: Windows Server 2003, IIS6 1. exwc.exe keeps running after submiting a form until CGI Timeout. But when compiled to exe it works as expected. 2. I found the postdata() in LibCGI v1.5 doesn't work correctly, to be specific the "HEREHEREHEREHERE" part.
global function post_data() object in sequence buf buf = {} while 1 do in = gets(0) --HEREHEREHEREHERE if equal(in, -1) then return buf else if in[length(in)] = '\n' then -- strip \n in = in[1..length(in)-1] end if buf &= in end if end while end function
And I change it according to the CGI Support Routines by Aku
global function post_data() object lenq lenq = getenv("CONTENT_LENGTH") if atom(lenq) or length(lenq) < 1 then return "" else return get_bytes(0, val(lenq)) end if end function
And it works. So why get_bytes() not gets()? 3. I can't read data from a form enctype="multipart/form-data", neither get_bytes() nor gets(). The LibCGI v1.5 routine doesn't work, and Aku's library contains no routine for that. Thanks in advance.