Closed apr3vau closed 2 years ago
I am sorry for the delay but I couldn't take the time out from getting CLOG Builder 1.0 out the door :)
I have added the support for file uploads in the last commit.
See clog-form.lisp for FORM-MULTIPART-DATA and DELETE-MULTIPART-DATA to get access to multipart submits and file data.
Here is a small code snip:
(defun on-new-window (body) (let* ((layout (create-panel-box-layout body)) (data (form-multipart-data body))) (center-children (center-panel layout)) (create-ftest (center-panel layout)) (create-div (center-panel layout) :content (form-data-item data "test-val")) (when data (destructuring-bind (stream fname content-type) (form-data-item data "ftest") (let ((s (flexi-streams:make-flexi-stream stream :external-format :utf-8)) (b (make-string 1000))) (loop (let ((c (read-sequence b s))) (unless (plusp c) (return)) (print (subseq b 1 c))))) (delete-multipart-data body))) (run body)))
I added encoding to CREATE-FORM and also updated tutorial 17
Discussed in https://github.com/rabbibotton/clog/discussions/91