I think your problem is that you have opened the file for writing and you
then try to reuse the same object to read.  if you close the file and then
reopen it for reading it should work.

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

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

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()}])


On Tue, May 29, 2012 at 2:57 PM, Leandro Severino <
[email protected]> wrote:

> Friends,
>
>
> On 29 maio, 15:44, Primoz Anzur <[email protected]> wrote:
> > Shannon already gave you a link to the way how the files are uploaded.
> > What seems to be the problem?
>
> my form:
>
> http://dpaste.com/753091/
>
> my controller:
>
> http://dpaste.com/753087/
>
> Now, I receive a error message "Bad file descriptor"
>
>
> --
> 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.
>
>

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