This is my code:

def report_download(result, colnames):

    import cStringIO
    stream = cStringIO.StringIO()
    render_report_csv(stream, result, colnames=colnames)
    filename = '%s-%s-%s.csv' % (request.function, request.args(0),
request.now)

    #For inserting file to the blobstore
    file_name = files.blobstore.create(mime_type='text/csv')
    with files.open(file_name, 'a') as f:  f.write(stream.getvalue())
    files.finalize(file_name)
    blob_key = files.blobstore.get_blob_key(file_name)
    blob_reader = blobstore.BlobReader(blob_key)
    blob_info = blobstore.get(blob_key)

    url = "https://"+http_host+"/"+request.controller+"/"+"download"+";?
key="+str(blob_key)# email url to admin
    message = "<html><a href="+url+">Download</a></html>"
    mail.send(to=person_email, subject='Report Download',
message=message, attachments =
Mail.Attachment(payload=blob_reader,filename = filename))
    return stream.getvalue()

This is the error that is shown in google app engine log:
Mail.send failure:'int' object has no attribute 'lower'

That too it shows as a warning.

Please suggest

On Feb 23, 11:57 am, Christian Foster Howes <[email protected]> wrote:
> do you have a full stack trace with that and a code sample?  I've never
> tried to do this myself, but perhaps i can help debug.
>
> On 2/22/12 22:55 , Saurabh S wrote:
>
>
>
> > Yes  I m using GAE blobstore. I am sending the blob reader as payload
> > and a filename. I m getting this error:
> > "'Int' object has no attribute lower".
>
> > Can you please suggest what might be the reason behind it?
>
> > On Feb 23, 1:03 am, howesc<[email protected]>  wrote:
> >> by blobstore you mean you are running on GAE using the GAE blobstore
> >> right?  checkout this section of the GAE docs:
>
> >>http://code.google.com/appengine/docs/python/blobstore/overview.html#...

Reply via email to