3 messages in com.googlegroups.pylons-discussRe: File Uploads Issue / Question
FromSent OnAttachments
Jonathan Vanasco27 Jun 2008 11:52 
Mike Orr27 Jun 2008 12:15 
Jonathan Vanasco27 Jun 2008 13:01 
Subject:Re: File Uploads Issue / Question
From:Jonathan Vanasco (jvan@gmail.com)
Date:06/27/2008 01:01:19 PM
List:com.googlegroups.pylons-discuss

On Jun 27, 3:16 pm, "Mike Orr" <slug@gmail.com> wrote:

I got that same problem.  it's a bug in the upload object used by cgi.FieldStorage.  You can't test it for truth or booleanize it.

Nice to know I'm not alone. Or a really inept programmer.

Instead you can compare it to None:

if self.form_result["myfile"] is not None:

Or you can check if it has an attribute like 'filename', which an actual upload would.

great ideas. much better than my attempts.