[Zope] mime attachments and multi-part forms

Michel Pelletier michel@digicool.com
Tue, 14 Sep 1999 02:14:51 -0400


"Jay, Dylan" wrote:
> 
> I trying to create a form that conditionally allows files to be included in
> the submission. This is no problem. However I want these files to be sent in
> an email message. Using the <dtml-mime> and <dtml-boundry> tags is fine
> however I can seem to do something like the following
> <dtml-mime><dtml-if blah><dtml-boundry><dtml-var blah></dtml-mime>

I'm assuming you mean to close the /if tag before the /mime tag.

> This seems a big shortcoming in the syntax of the mime tag. Has anyone
> managed to get around this?

This is a block syntax issue in general.  The structure above violates
the parser rules.  A possibility is to have a conditional boudary tag. 
Otherwise you have to write two mime blocks inside a wrapping if -else
block.

A conditional boundary tag wouldn't be to hard, want to take a stab at
it?

> Also, with the multipart form, is there anyway to get at the filename of the
> file uploaded and then subsequently use that as the name of the attachment
> in the email?

You can get to the name, but not attach it to the block.  This is a
simple fix and would be a good warm up exercise to fulfill your above
requirements.

-Michel