Alec Matusis
matusis at matusis.com
Fri Apr 21 18:33:39 EDT 2006
Is there a way to read the request by lines in the filter, rather than trying to read the entire buffer? That way at least the text that I am trying to replace will come in a single read, when I read that line. Or will it be to slow? -----Original Message----- From: Graham Dumpleton [mailto:grahamd at dscpl.com.au] Sent: Friday, April 21, 2006 3:24 PM To: Alec Matusis Cc: mod_python at modpython.org Subject: Re: [mod_python] ValueError with Flash 8 FileReference.upload(url) Actually there is another problem that only came to me later. That is that there is no guarantee with an input filter that you are going to get the complete text you are trying to replace in one read even if it was written in one go by the client. This is because you are at the mercy of how blocking of data reads off the client socket works out. A patching of the util.FieldStorage class may be the only way around that. Graham On 21/04/2006, at 7:40 PM, Alec Matusis wrote: > Yes, I got that. > Thanks, I tested it, all works well. > > I hope this filter does not tax the performance too much when I > submit large > files? > > -----Original Message----- > From: Graham Dumpleton [mailto:grahamd at dscpl.com.au] > Sent: Friday, April 21, 2006 2:39 AM > To: Alec Matusis > Cc: mod_python at modpython.org > Subject: Re: [mod_python] ValueError with Flash 8 > FileReference.upload(url) > > Whoops. > > > On 21/04/2006, at 7:23 PM, Graham Dumpleton wrote: > >> A creative way of getting around the problem. I hadn't thought >> of using a filter. Some suggested changes below. >> >> On 21/04/2006, at 6:12 PM, Alec Matusis wrote: >> >>> >>> I figured out how to do this without changing mod_python source: >>> >>> I wrote a mod_python input filter: >>> >>> flashfilter.py: >>> >>> from mod_python import apache >>> >>> def inputfilter(filter): >>> #this is a workaround flash 8 FileReference bug: Flash POST is >>> not >>> RFC-compliant as of Flash 8,0,22,0 >> >> >> if 'flashfileref' in parse_args(filter.req.args): >> filter.pass_on() >> return > > Logic wrong way around. > > if 'flashfileref' not in parse_args(filter.req.args): > filter.pass_on() > return > > Graham
|