To clarify a bit; I can get a file-upload field on a form, as follows:
(modifying examples/weblocks-demo/src/model/company.lisp)
(defclass company ()
...
(file :initform nil
:accessor company-file
:initarg :file)))
;;; Form View
(defview company-form-view (:type form :inherit-from '(:scaffold
company))
(id :hidep t)
(file :present-as (file-upload)
:parse-as (file-upload
:upload-directory (path-rel-to-install "uploads")
:file-name :unique)))
*) This gives me a weblocks error:
"SIMPLE-ERROR: The value of the upload field is incorrect. Please turn
on multipart requests and turn off ajax."
*) I tried with javascript enabled & disabled in the browser, same
result.
*) How can i get this to work?
*) How do i access the uploaded file?
(I see that the method (defmethod parse-view-field-value ((parser file-
upload-parser) value obj...) returns multiple values including the
list of values from the multi-part, and the local file name. I dont
know how these are stored in the 'file' slot in the example above, or
how i would access them).
Cheers
m
On Nov 24, 9:29 pm, mike <[email protected]> wrote:
> Hi
>
> Can anyone point me to a recent example of using file-upload?
> Searching this list gives examples over a year old which seem to be
> before src/views/types/file-upload.lisp was added.
>
> Cheers
>
> Mike
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"weblocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/weblocks?hl=en
-~----------~----~----~----~------~----~------~--~---