It doesn't seem to work very good.
I'll read about X-Sendfile, don't know if it suits my purpose.

On Mon, Apr 26, 2010 at 8:52 PM, Dexter <a.essel...@gmail.com> wrote:

> I'm using both,
>
> I'm not familiar with X-Sendfile,
>
> But my situation is this: I have a folder with my music collection, I scan
> the folder and record the pathnames.
> Because I don't want to set this folder public, I want to manage the user
> login with django so not everyone can download my music.
>
> Is this possible with X-Sendfile?
>
> TY Nick, I'll try this one. But I guess X-Sendfile is a better solution.
>
> Grtz, Dexter
>
> On Mon, Apr 26, 2010 at 8:43 PM, Christophe Pettus <x...@thebuild.com>wrote:
>
>> Another possibility, if you are using either Apache or Lighttpd, is the
>> X-Sendfile header, so that the Python process does not have to handle the
>> content.
>>
>>
>> For lighttpd:   http://blog.lighttpd.net/articles/2006/07/02/x-sendfile
>> For Apache:     http://tn123.ath.cx/mod_xsendfile/
>>
>>
>> On Apr 26, 2010, at 10:41 AM, Nick Serra wrote:
>>
>>  Interesting. If the file is an mp3, maybe try:
>>>
>>> file = open("/path/to/my/song.mp3", "rb").read()
>>> response['Content-Disposition'] = 'attachment; filename=filename.mp3'
>>> return HttpResponse(file, mimetype="audio/mpeg")
>>>
>>>
>>> On Apr 26, 1:20 pm, Dexter <a.essel...@gmail.com> wrote:
>>>
>>>> Hi there,
>>>>
>>>> I want to send an audio file via a django view, but I don't know how.
>>>>
>>>> This doesn't seem to work:
>>>>
>>>>    return HttpResponse(open(song.path).read(), mimetype = "audio/mpeg")
>>>>
>>>> Can you guy's help me?
>>>>
>>>> Grtz, Dexter
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Django users" group.
>>>> To post to this group, send email to django-us...@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
>>>> .
>>>> For more options, visit this group athttp://
>>>> groups.google.com/group/django-users?hl=en.
>>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Django users" group.
>>> To post to this group, send email to django-us...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>>
>> --
>> -- Christophe Pettus
>>   x...@thebuild.com
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-us...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.

Reply via email to