Hi Ben,

> uploaded_file=i.curriculo
>
> resume_file = open('uploads/'+ uploaded_file.filename,"wb")
> resume_file.write(uploaded_file.file.read())
> resume_file.close()
>
> resume_file = open('uploads/'+ uploaded_file.filename,"rb")
>
> web.sendmail(email, to_email, '%s' % assunto, '%s' % mensagem_completa,
> attachments=[resume_file])
>

This way works fine.

> Also, you don't need to write the file to disk if you are only interested
> in sending it in an email.
>

this was my hope

> You could accomplish it like this:
>
> uploaded_file=i.curriculo
>
> web.sendmail(email, to_email, '%s' % assunto, '%s' % mensagem_completa,
> attachments=[{"filename":uploaded_file.filename, "content"
> :uploaded_file.file.read()}])
>

This way, works but send the file with 0 bytes.

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to