[Bese-devel] UCW file upload example

Marco Baringer mb at bese.it
Thu Jul 21 15:17:56 UTC 2005


Mac Chan <lispweb at mac.e4ward.com> writes:

>  (defmethod get-parameter ((request httpd-request) name)
> -  (let ((cons (assoc name (parameters request) :test #'string=)))
> -    (when cons (copy-seq (cdr cons)))))
> +  (let* ((cons (assoc name (parameters request) :test #'string=))
> +         (value (cdr cons)))
> +    (when cons (copy-seq (if (mime-part-p value)
> +                             (mime-part-body value) value)))))
>
>  (defmethod map-parameters ((request httpd-request) lambda)
>   (dolist* ((name . value) (parameters request))
> -    (funcall lambda name (copy-seq value))))
> +    (funcall lambda name (copy-seq
> +                          (if (mime-part-p value)
> +                              (mime-part-body value) value)))))
>
>  (defun read-request-headers (backend stream)
>   (iterate
> ------------------------------------------->8--------------------------------------

actually, this is wrong. in particular this makes it impossible to get
at any of the mime-headers associated with the parameter. in the case
of file uploads we (i at least) often need the file's name and
content-type. 

i think i'm going to leave get-parameter as it is and fix the code in
the file upload example to deal with mime-part object. you (or anyone
else) have anything agaisnt this?

-- 
-Marco
Ring the bells that still can ring.
Forget the perfect offering.
There is a crack in everything.
That's how the light gets in.
	-Leonard Cohen



More information about the bese-devel mailing list