[Zope] Re: Mail (Supplement)
Flynt
rhess@bic.ch
Wed, 04 Jul 2001 21:32:25 +0200
Vid B wrote:
>
> Thank you Flynt,
>
> You have my permission to CC to the list at any time
> :)
>
> I e-mailed to you personally because I saw that you
> had the same problem I do, and I hoped that way I will
> get reply sooner.
>
> While I was waiting for you I played around and
> succeed to attach pdf document, but I cannot get right
> name (instead of name it gives me '-' ). Here is the
> code that I was using.
>
> <dtml-mime type=application/pdf encode=7bit>
> Attached is the document you requested.
> <dtml-boundary name=report.pdf type=application/pdf
> disposition=attachment encode=uuencode
> filename=report.pdf>
> <dtml-var expr="restrictedTraverse('report.pdf')">
> </dtml-mime>
>
> I tried code you sent me and it gives me strange
> results. I tried testimage.data and got lots of
> gibberish, and than I tried testimage
> and got a little gibberish but not the image itself.
> Did I miss something?
>
> Vid
Hi Vid
I tried the DTML which I included in my answer to you, first for myself.
And it did work for me (Zope 2.3.2 source release on Linux). So at that
point it is difficult to say for me, why it doesn't work in your case.
Maybe, some small item got overlooked, when you tried it, or, there are
problems with your email client, or ... still something else.
So I took your code above and tested it:
Actually, I am a little bit surprised, that the first two lines of your
code should work with you (it didn't for me):
> <dtml-mime type=application/pdf encode=7bit>
> Attached is the document you requested.
Here, you are sending text, but your type is application/pdf.
Consequently I don't get the text message, when I try but only a faulty
link to a MIME part. But this is easy: just change
*type=application/pdf* to *type=text/plain*.
For the rest of your code: It is working. I get cleanly the pdf file
with the rest of your code **including** the name *report.pdf* as
attachment in my email viewer (Netscape). The problem of your missing
name is not a problem of your code, but of something different (maybe
it's in your email client). Note, that it is **not** a problem of
encoding (as you suggested in an earlier mail): I tried your code above
with uuencode _and_ with base64 and it works in both cases.
Regards
--- Flynt