[mod_python] Input filter

Graham Dumpleton grahamd at dscpl.com.au
Tue Dec 26 06:24:36 EST 2006


On 26/12/2006, at 10:14 PM, export at hope.cz wrote:

> Graham,
> Thank you for your reply.
> I downloaded Tramline,
> but it says:
> Requirements
> ------------
> ...
> ...
>
> * You tend to need mod_proxy installed to proxy requests that come
>   into Apache into your underlying appserver. It also works with
>   mod_rewrite if you use proxying mode for this ([P]).
> -----------------
>
> Must I really have mod_proxy installed?
>
> And how can  I check that the file being uploaded( via  
> inputfilter)  is being saved on hard disk
> directly  and not to memory.

I specifically said in my email:

   Just because Tramline is intended more for cases where Apache is
   front ending a backend application doesn't mean it isn't a valid  
example
   of input filters, you would just need to adapt the ideas to your  
needs.

So I already said that it isn't exactly what you require. What you  
should do
is read through the code and the mod_python documentation and learn
from it so you can work out how you can customise it to do what you  
want.
You do not need to be using mod_proxy to use input filters, Tramline was
using it for specific reasons of its own.

The relevant part of the mod_python documentation is:

  http://www.modpython.org/live/current/doc-html/pyapi-filter.html

The example is for an output filter, but input filters work almost  
the same.

Also look back through past mailing lists post by using search box on  
the
mod_python web site. A slightly more complicated example of an output
filter is:

   http://www.modpython.org/pipermail/mod_python/2006-April/020870.html

Overall though, the Tramline code is the most complicated example of an
input filter I have seen.

Graham

>>> Can anyone give me an example of an Input filter?
>>> I would like to check if a  file being uploaded is large and if so,
>>> I would like to write the file
>>> directly on hard disk not to memory.
>>
>> Did you look at Tramline as I suggested the last time you asked about
>> file uploads?
>>
>> Tramline is an input filter and also seeks to solve the problem of  
>> how
>> to handle large file uploads.
>>
>> The URL for Tramline is:
>>
>>    http://www.infrae.com/download/tramline
>>
>> Just because Tramline is intended more for cases where Apache is
>> front ending a backend application doesn't mean it isn't a valid  
>> example
>> of input filters, you would just need to adapt the ideas to your  
>> needs.
>>
>> Graham
>


More information about the Mod_python mailing list