You form must have <form enctype="multipart/form-data">....</form>
you will file the file in request.vars.file.file.read() and the filename in request.vars.file.filename request.vars.file is a cgi.FieldStorage object (look in the Pyhon cgi module) and "file" is the name of your field. On Aug 2, 5:48 pm, ae <ae88...@gmail.com> wrote: > First, We're not using the DAL. Our database provides stored > procedures for all manipulation. I've got quite a large (to me) > web2py application with 20-25 controllers and over 100 templates. > We've got our own class hierarchy that sort-of wraps the db procedures > and represents our data model. > > I have a page where I need a file uploaded and available to me to > insert into the db via a stored procedure. > > I have a form in my template (<form method="POST" action="../ > upload"><input type="file" name="file" /><input type=submit /></ > form>), but I don't see anywhere to retrieve the contents of the > file. I can see that I get the form post data in request.body.read(), > but where are the file contents? > > I've searched the groups but it appears that everyone is using the SQL > libraries to produce their forms... > > --ae