then my complete code:

in form.html:

<h1>Trabalhe Conosco</h1>
<form id="contato" action="/trabalhe-conosco" method="post">
    <span class="nome_field">Nome:</span>
    <input id="nome" class="fields" title="Informe o seu nome."
name="nome" type="text" />
    <span class="fields">Telefone:</span>
    <input id="telefone" class="fields" title="Informe o seu
telefone." name="telefone" type="text" />
    <span class="fields">E-mail:</span>
    <input id="email" class="fields" title="Informe o seu e-mail."
name="email" type="text" />
    <span class="fields">Curriculo:</span>
    <input id="curriculo" class="fields" title="Envie o seu
cirriculo." name="curriculo" type="file" />
    <span class="fields">Mensagem:</span>
    <textarea id="mensagem" title="Deixe sua mensagem." cols="20"
rows="10" name="mensagem"></textarea>
    <button>Enviar</button>
</form>

in my controller.py:

class TrabalheConosco:
    def POST(self):
        try:
            i = web.input()
            assunto='Curriculo enviado pelo site www.redesosturbo.com.br'
            nome='O candidato ' + break_string(i.nome)
            telefone=' com o telefone: ' + break_string(i.telefone)
            email=' com o E-mail: ' + break_string(i.email)
            mensagem='Deixou a seguinte mensagem: ' + '\n\t' +
break_string(i.mensagem)
            mensagem_completa = nome + telefone + email + mensagem
            to_email = '[email protected]'
            """
              the critical code
            """
            uploaded_file=i.curriculo
            resume_file = open('uploads/'+ uploaded_file.value ,"wb")
# in this line give this error: 'unicode' object has no attribute
'value'
            resume_file.write(uploaded_file.content)
            web.sendmail(email, to_email, '%s' % assunto, '%s' %
mensagem_completa, attachments=[resume_file])
            raise web.seeother('/agradece-contato')
        except Exception:
            raise

any idea ?

-- 
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