Sorry, I had deleted this post because I realized that I had posted
the wrong code. (This was after I had spent awhile trying to fix it.
At this point, I was just grasping at straws and it probably didn't
make any sense.)

I posted the original broken code in a different post.  I also posted
the traceback.

Thank you for your help...


On Nov 21, 6:34 am, Christoph Zwerschke <[email protected]> wrote:
> Am 21.11.2010 03:54 schrieb Karen McNeil:
>
> > I've got it half working:  the form field is working fine, and the
> > filename is successfully added to the database.  The problem comes up
> > when I added the code to actually save the file to the folder where it
> > should be; I get the error: *"TypeError: coercing to Unicode: need
> > string or buffer, instance found."
>
> The exact place where the error happens is even more important for
> finding the cause of such problems, you get it from the traceback.
>
> I guess it happens in this line:
>
> >          newtext = codecs.EncodedFile(new_file.value, 'utf-8')
>
> The EcodedFile method takes a file object as first parameter, but
> new_file.value gets your file data as a string. If you want to access
> the data as a file object, use new_file.file instead.
>
> -- Christoph

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.

Reply via email to