John Mudd
JohnMudd at mindspring.com
Fri May 7 04:30:10 EST 2004
Yes, changing to enctype="multipart/form-data" made a difference. Now I get a standard popup window from my browser asking me if I want to save the file to disk or open it using an application. That's better. Before I just got the name of the file. But I want my mod_python script to have access to the file contents, not the browser. Does anyone have an example of uploading a file using mod_python. Thanks, John On Fri, 2004-05-07 at 04:23, mod_python-request at modpython.org wrote: > > > -----Original Message----- > From: mod_python-bounces at modpython.org > [mailto:mod_python-bounces at modpython.org] On Behalf Of John Mudd > Sent: jeudi 6 mai 2004 19:21 > To: mod_python at modpython.org > Subject: [mod_python] upload file? > > > > (Sorry if you see this msg twice. I submitted this earlier today by under a > non-member email address.) > > > > I'm trying to upload a file. I specified a "file" type input field in my > HTML, it displays as expected with the "Browse..." button, I'm able to > select a file but... > > > > When I look in the FieldStorage dictionary for the field I only get a String > type field that is the file name. I was expecting a "Field" type object > that would provide access to the file name and contents. > > > > What am I missing? > > > > John > > _______________________________________________ > > Mod_python mailing list > > Mod_python at modpython.org > > http://mailman.modpython.org/mailman/listinfo/mod_python > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: http://mailman.modpython.org/pipermail/mod_python/attachments/20040506/2ac41b82/attachment-0001.html > > ______________________________________________________________________ > > From: Daniel J. Popowich <dpopowich at mtrsd.k12.ma.us> > To: mod_python at modpython.org > Subject: RE: [mod_python] upload file? > Date: 06 May 2004 15:37:45 -0400 > > > > The default value for the enctype attribute of the FORM element is > application/x-www-form-urlencoded, as in: > > <FORM method="POST" enctype="application/x-www-form-urlencoded"> > > when doing file uploads you need to specify: multipart/form-data, as > in: > > <FORM method="POST" enctype="multipart/form-data"> > > -d > > > > ______________________________________________________________________ >
|