[Bese-devel] Content-Type for uploaded files?
Marco Baringer
mb at bese.it
Mon Mar 14 06:26:14 UTC 2005
ocorrain at yahoo.com (Tiarnán Ó Corráin) writes:
> Hi--
>
> how can I get the content-type of uploaded files? I have taken code
> from the example application, viz.:
eventually i did in fact need this. what i ended up doing (which is,
currently, Just Wrong) is this:
when the post data's type is "multipart/form-data" the parameters,
which are still bonud by name, are not strings but mime-part objects,
these objects are just a pair of headers (assoc list) and the body (a
string). the problem with this solution is that entry points and
callbacks need to know whether the incoming data is
multipart/form-data or regular url-encoded. (you'll notice that the
"s", "f" and "a" parameters are special cased since various parts of
the rerl assume they're strings). what i'll do, eventually, is put the
body of the form-data in the request parameters and provide a function
MIME-PART-DATA (or something) which, given the name of a parametetr,
returns all the various mime headers.
at least that's what i'll do if no one comes up with a better solution
(hint hint hint).
--
-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