On Wed, 2007-04-04 at 17:31 -0700, queezy wrote: > Hi! > > Sorry it took a while - I had to get the info from work. > > Renderer mode: Quirks mode > Cache source: Not cached > Encoding: UTF-8 > > The other stuff was blank. > > My view is as follows: > > ========== SNIP ========== > from django.http import HttpResponse > from django.shortcuts import render_to_response > import urllib > > def front(request): > sock = > urllib.urlopen("/home2/a12007/webapps/officeprofiler/profiler/templates/officechoice.html") > html = sock.read() > sock.close() > return HttpResponse(html) > > def officereport(request): > selected_choice = request.POST['office'] > sock = > urllib.urlopen("/home2/a12007/webapps/officeprofiler/profiler/"+selected_choice) > html = sock.read() > sock.close() > return HttpResponse(html)
If this is the method that returns your PDF, the problem is clear. You are NOT setting the mimetype. So Django defaults to sending it with an HTML mimetype and your browser correctly respects that and tries to display the result as if it were an HTML. You have to set the mimetype for any non-HTML data. This was mentioned earlier in the thread -- Ned even gave you an example. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---