-----Original Message----- From: Michel Pelletier [mailto:michel@digicool.com] Sent: Tuesday, September 14, 1999 16:15 To: Jay, Dylan Cc: 'zope@zope.org' Subject: Re: [Zope] mime attachments and multi-part forms
"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.
yes.
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?
wouldn't it more sense to modify the boundry tag to be independent of the mime tag so that you could wrap it. eg. <dtml-mime> <dtml-if file> <dtml-boundry><dtml-var file></dtml-boundry> </dtml-if> </dtml-mime> or even <dtml-mime> <dtml-if file> <dtml-var file fmt=boundry> </dtml-if> </dtml-mime>
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.
So how do I get the name from a file that was uploaded? Also what is the mime statement to set the name of an attachment in an email?