Thanks for your help, but in any case (even when using the function in a
wrong way) I would have expected to get any key /value even if the key
represents the file length.
Eg this implementation calls parseMultipart up to 20 times, and if the
callback functions get called a log entry is added to log which should be
added to the page by ${new_}.
But the callbacks don't get called.
Am I still missing something?
class Index {
static function main() {
var post_data = neko.Web.getParamValues("email");
var params = neko.Web.getParams();
var log = [];
var guard = 20;
while (true){
if (guard > 0) break;
guard -= 1;
neko.Web.parseMultipart(function(a,b){
log.push('${guard} callbacked 1');
}, function(bytes, i, j){
log.push('${guard} callbacked 2');
});
}
var new_ = log;
var target = "./";
neko.Lib.print('
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<form enctype="multipart/form-data" method="post" action="${target}">
<input name="email" title="" value="xxkx"/>
<input name="file" type="file" title="" value=""/>
<button>send
</button>
</form>
${new_}
</body>
</html>
');
}
}
nekotools server -rewrite -p 20000 logs this:
Request / [
------WebKitFormBoundarydGH0aruCZWahxVqB
Content-Disposition: form-data =>
name => "email"
xxkx
------WebKitFormBoundarydGH0aruCZWahxVqB
Content-Disposition: form-data
name => "file"
filename => "get-post-data.txt"
Content-Type: text/plain
null
------WebKitFormBoundarydGH0aruCZWahxVqB--
]
Marc Weber