Hello all,

im using django-sendfile with django 1.8.4. Tested with development backend and runserver, everything is fine. But when going to Apache2 and xsendfile backend, the downloaded files are empties, i don't understand why.
I have:
MEDIA_ROOT = '/home/devel/media/python3/media'
and Images are in MEDIA_ROOT

In apache2 conf:
<Directory /home/devel/media/python3/media/Images/>
    Options Indexes FollowSymLinks MultiViews
    XSendFile On
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

and in views.py, i have:
    response = HttpResponse(content_type='application/force-download')
    response['Content-Disposition'] = 'attachment;filename="%s"'\
                                    % smart_str(img.name)
    response["X-Sendfile"] = img.image.path
    response['Content-length'] = img.image.size
    return response

Anybody can help?

Thanks in advance,
--
GĂ©rard Henry

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/55F972E8.3090800%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to