diff --git a/multipart-form/multipart-form.raku b/multipart-form/multipart-form.raku index f967d5d..bb920c1 100755 --- a/multipart-form/multipart-form.raku +++ b/multipart-form/multipart-form.raku @@ -51,7 +51,13 @@ get '/', -> $request, $response { }; post '/', -> $request, $response { - dd $request.content; + my Str $filename = + $request.content ~ + '.' ~ + $request.content.split('/')[1]; + my Buf $file-body = $request.content; + + ('uploads/' ~ $filename).IO.spurt: $file-body; $response.redirect('/'); };