On Dec 30, 8:24 pm, "Aaron Swartz" <[email protected]> wrote:
> file uploads have to be declared like so:
>
> web.input(file={})

Yes I know, and I did it this way.
Here my further investigations:

This works:
f = web.input(datei={})
self.datei = f['datei'].value

Put this gives me the error bellow (here I also use web.input().name:
f = web.input(datei={})
self.datei = f['datei'].value
self.name  = web.input().name

My form has not just the file fieled but also at least a name field.

Traceback (most recent call last):
  File "packages/web/application.py", line 211, in process
    return self.handle()
  File "packages/web/application.py", line 201, in handle
    return self._delegate(fn, self.fvars, args)
  File "packages/web/application.py", line 385, in _delegate
    return handle_class(cls)
  File "packages/web/application.py", line 360, in handle_class
    return tocall(*args)
  File "newsletter.py", line 918, in POST
    h.input()
  File "Header.py", line 52, in input
    self.name  = web.input().name
  File "packages/web/webapi.py", line 222, in input
    return storify(out, *requireds, **defaults)
  File "packages/web/utils.py", line 141, in storify
    value = getvalue(value)
  File "packages/web/utils.py", line 128, in getvalue
    return unicodify(x.value)
  File "packages/web/utils.py", line 123, in unicodify
    if _unicode and isinstance(s, str): return safeunicode(s)
  File "packages/web/utils.py", line 231, in safeunicode
    return obj.decode(encoding)
  File "encodings/utf_8.py", line 16, in decode
UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 0:
unexpected code byte

Erwin

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to