-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The with-html-form seems to fail uploading a file #1
Comments
Interesting. I've never tried it. Seems like a bug. Please, try to fix it and let me know if you'll need some help. |
https://github.com/40ants/weblocks/blob/reblocks/src/js/jquery/jquery.js#L12 https://api.jquery.com/serializeArray/
Also, my code works correctly with Javascript disabled which makes it a full non-ajax request. I have no idea what to do about it. |
Well, the workaround is to disable ajax for this form. weblocks can already do it. But can we fix it to make ajax upload work too? |
Could you please create a minimal app.lisp file to reproduce and experiment with this problem and post it here or upload as to the https://gist.github.com/? |
(in-package :cl-user)
(eval-when (:compile-toplevel :load-toplevel :execute)
(ql:quickload '(:weblocks :weblocks-ui)))
(weblocks/app:defapp upload-test :prefix "/")
(defmethod weblocks/session:init ((app upload-test))
(make-instance 'main))
(weblocks/widgets/base:defwidget main () ())
(defmethod weblocks/widgets/base:render ((main main))
(weblocks-ui/form:with-html-form (:post (lambda (&key file &allow-other-keys)
(format t "*** FILE UPLOAD: ~S" file))
:enctype "multipart/form-data")
(:input :type "file" :name "file") (:br)
(:input :type "submit" :value "Submit")))
(weblocks/server:start) Just load it. |
I've tested it myself. Unless you disable Ajax with Thus, the only option is to add It will be a good to add a |
The form Action doesn't get the :file keyword argument.
The text was updated successfully, but these errors were encountered: