Re: pdf file generated problem

2008-10-07 Thread Thomas Guettler
Hi. what is "attach"? It is StringIO object. And these objects don't have a name attribute. try this: mail.attach('mypdfname.pdf', attach.get_value(), 'application/pdf') HTH, Thomas laspal schrieb: > ok I can use cStringIO for it but my real problem is how to attach > file in emailme

Re: pdf file generated problem

2008-10-07 Thread laspal
ok I can use cStringIO for it but my real problem is how to attach file in emailmessage?? response = HttpResponse(mimetype='application/pdf') response['Content-Disposition'] = 'attachment; filename=report1.pdf' buffer = StringIO() p = canvas.Canvas(buffer) pdf = buffer.getvalu

Re: pdf file generated problem

2008-10-07 Thread Thomas Guettler
Hi Iaspal, here is what I think: - Why do you use try:...except? You don't see the real traceback. If you want to add debugging information (eg. logging.error('...')) you could do it like this: try: except: logging.error('...') raise # reraise exception - Why do you use HttpRespons

pdf file generated problem

2008-10-06 Thread laspal
Hi, I am trying to generate pdf file and send the generated file by mail to the user. But I am getting value error as I am not sure how to attach file. here is my view function: def companies_report(request, companyid): _user = request.user sender = _user.email company = Company.obje