[Zope] EMail with uploaded attachments, Part II

Dieter Maurer dieter@handshake.de
Fri, 26 Jan 2001 22:56:24 +0100 (CET)


Klaus Herrmann writes:
 > ...
 > How do I determinate the filename and mime-type of the uploaded file?
 > 
 > i have 
 > <input type=file size=18 maxlength=3000000 name=attached_file>
 > and can get my data with attached_file.read(), but how do i do it when i want
 > to have filename and mime-type correctly filled in in
 > <dtml-boundary type=??? encode=base64 filename=??? name=???>
Maybe, you should look at the source documentions
for "ZPublisher.HTTPRequest.FileUpload".

You will see there, that "FileUpload" objects have attributes
'filename' and 'headers'.
In headers, you will find the "Content-Type", provided that
your browser has send this information (as it should).

Then, you need to know, that "dtml-boundary" has
"*_expr" argument variants that allow to provide expressions
as values rather than fixed constants.

That's all you should need.


Dieter