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

6 views
Skip to first unread message

F.S

unread,
Apr 22, 2006, 4:39:02 PM4/22/06
to 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

unread,
Apr 25, 2006, 12:50:45 PM4/25/06
to 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

unread,
Apr 26, 2006, 3:50:36 AM4/26/06
to web.py

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

// FS

Aaron Swartz

unread,
Apr 26, 2006, 8:17:53 AM4/26/06
to 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

unread,
Apr 26, 2006, 12:59:34 PM4/26/06
to web.py

It did :) Thanks Aaron.

// Fs

Reply all
Reply to author
Forward
0 new messages