Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Serve a binary/static file from view callable (with paste.fileapp?)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jasper  
View profile  
 More options Sep 20 2011, 9:12 am
From: Jasper <jap...@gmail.com>
Date: Tue, 20 Sep 2011 06:12:47 -0700 (PDT)
Local: Tues, Sep 20 2011 9:12 am
Subject: Serve a binary/static file from view callable (with paste.fileapp?)
Hi everyone,

I'd like to serve a (sometimes larger) binary file from one of my
views. It seems the preferred method of doing this is with
paste.fileapp.FileApp:

http://stackoverflow.com/questions/2413707/stream-a-file-to-the-http-...

(see last response)

docs: http://pythonpaste.org/modules/fileapp.html

However, the code example is for pylons, and I don't think
"self.start_response" has any meaning in a pyramid view callable,
right? If so, I don't know what it means.

So,

1) do you indeed think this is the best way to deal with possibly
larger (non-text) files?

2) how should i use it in a pyramids view?

Thanks!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gael Pasgrimaud  
View profile  
 More options Sep 20 2011, 9:42 am
From: Gael Pasgrimaud <g...@gawel.org>
Date: Tue, 20 Sep 2011 15:42:53 +0200
Local: Tues, Sep 20 2011 9:42 am
Subject: Re: Serve a binary/static file from view callable (with paste.fileapp?)
Hi,

No, the best way is to use a real webserver like nginx with the
xsendfile module: http://wiki.nginx.org/XSendfile

> 2) how should i use it in a pyramids view?

this should work:

def file_view(request):
   return request.get_response(FileApp(filename))


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jasper van den Bosch  
View profile  
 More options Sep 20 2011, 4:22 pm
From: Jasper van den Bosch <jap...@gmail.com>
Date: Tue, 20 Sep 2011 22:22:44 +0200
Local: Tues, Sep 20 2011 4:22 pm
Subject: Re: Serve a binary/static file from view callable (with paste.fileapp?)

Thanks!

On 20 September 2011 15:42, Gael Pasgrimaud <g...@gawel.org> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »