Re: Returning a file from a view

2009-10-02 Thread Javier Guerra
On Fri, Oct 2, 2009 at 7:51 AM, Marcelo Criscuolo (Jaú) wrote: > I'm thinking of something like this in the view: > > response = HttpResponse(mimetype="") > input = read contents of your hidden file > response.write(input) > return response and once it's working, replace the actual data copying

Re: Returning a file from a view

2009-10-02 Thread Jaú
I'd try to use HttpResponse as a file object. As in http://docs.djangoproject.com/en/dev/howto/outputting-pdf/#write-your-view. I'm thinking of something like this in the view: response = HttpResponse(mimetype="") input = read contents of your hidden file response.write(input) return response

Returning a file from a view

2009-10-01 Thread Rodrigo Cea
I am creating a password-protected file repository. I would like to create a login_required view that returns the file without revealing it's actual location in the file system. Can I return an actual file (not it's location) from a view? --~--~-~--~~~---~--~~ You r