2009/7/17 Ken <[email protected]>
> Hi, I try to upload file. when I upload a text file, it is ok, and upload
> an image, it failed, retruns:
>
> UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 0:
> unexpected code byte
>
>
> why? how to fix it? thks.
>
> # new.html
> <form action="?" method="post" class="edit_form"
> enctype="multipart/form-data">
> <input type="file" name="myfile" />
> ...
>
> # product.py
> class New:
>
> def POST(self):
> i = web.input()
Use: i = web.input(myfile={})
>
> this_file = i.myfile
> return 'ok'
> ...
>
>
> --
> 大郎:百才招聘(baicai.com).产品部
> Email: [email protected]
> Gtalk: [email protected]
> twitter.com/qichangxing
>
> >
>
--
Arnaldo M Pereira
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" 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/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---