On Sun, Sep 20, 2009 at 8:47 AM, zweb <traderash...@gmail.com> wrote: > > When I try to download a file through django in IE , I get > > [Sun Sep 20 05:34:20 2009] [error] [client 127.0.0.1] response = > func(request, response), referer: http://www.....com > [Sun Sep 20 05:34:20 2009] [error] [client 127.0.0.1] File "/home/ > pmc/webapps/test/lib/python2.5/django/http/utils.py", line 77, in > fix_IE_for_vary, referer: http://www......com/ > [Sun Sep 20 05:34:20 2009] [error] [client 127.0.0.1] if response > ['Content-Type'].split(';')[0] not in safe_mime_types:, referer: > http://www.....com/ > [Sun Sep 20 05:34:20 2009] [error] [client 127.0.0.1] AttributeError: > 'list' object has no attribute 'split', referer: http://www.....com/ > > > I am doing, > > for f in range(len(filepath)): > file_data = open('%s' % (filepath[f]), "rb").read() > response = HttpResponse(file_data,mimetype= content_type) > response['Content-Disposition'] = 'filename ='+ fname
This is wrong. You probably need something like this: response['Content-Disposition'] = 'attachment; filename=' + fname That being said, generating a zip archive of all files contained in `filepath` and sending this would make more sense than sending only the first file in the list. Matthias --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---