views:

34

answers:

2

Currently, I'm using request.params["filename"] to access uploaded files.

In Pylons, what is the syntax to access a file if you don't know the filename, something like request.files[0]?

+1  A: 

Based on what this: http://pylonshq.com/docs/en/1.0/forms/#file-uploads page says, you could search through the params or request.POST looking for values of the type cgi.FieldStorage

Craig
A: 

It's not the file name that's used as a key in request.params, it's the field name that was used in the HTML: <input type="file" name="fieldname">

Marius Gedminas