How do I get the file name from a file upload?

Visto 6 veces
Saltar al primer mensaje no leído

F.S

no leída,
22 abr 2006, 16:39:0222/4/06
a web.py
I have tried to run #2 shown in a postl[1] to the mailinglist. But I
get an error

exceptions.AttributeError at /upload2
'_inputfs'

How do I access _inputfs for the file name or how is it meant to be
done?

Thanks in advance.

[1]
http://groups.google.com/group/webpy/browse_thread/thread/a88fafed911e81ab/0890d982c8d98a43?q=upload&rnum=1#0890d982c8d98a43

Curtis

no leída,
25 abr 2006, 12:50:4525/4/06
a web.py
It looks like the names of some variables have changed in web.py since
my original post.

Try changing the 'web.context._inputfs' to 'web.ctx._inputfs' and the
example should work.

Cheers,

-Curtis

F.S

no leída,
26 abr 2006, 3:50:3626/4/06
a web.py

Tried to change to web.ctx._inputfs but still get:
exceptions.AttributeError at /upload2 '_inputfs'

// FS

Aaron Swartz

no leída,
26 abr 2006, 8:17:5326/4/06
a we...@googlegroups.com
OK, this should be fixed in the latest web.py:

http://webpy.org/svn/web.py

If you want a more complicated object returned, set the key to a
dictionary in web.input's defaults. That is:

fileobj = web.input(f={}).f

Also, the same thing now works with lists and getting multiple values back;

valuelist = web.input(v=[]).v

Hope this helps.

F.S

no leída,
26 abr 2006, 12:59:3426/4/06
a web.py

It did :) Thanks Aaron.

// Fs

Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos