On 9/20/07, slummer <[EMAIL PROTECTED]> wrote:
>
>
>
>
> On 9月20日, 下午6时21分, Anand <[EMAIL PROTECTED]> wrote:
> > On 20-Sep-07, at 3:08 PM, slummer wrote:
> >
> >
> >
> > > When i post a file to web.py, how can i get the file's name?
> > > For example, I commit a file which full path is "c:\temp\example.xml"
> > > to web.py, how can i get this file name:"example.xml" by web.py?
> >
> > i = web.input(f={})
> > print i.f.filename, i.f.value
>
> Thanks your answer, i follow your example in my code, but get the
> following error:
>
> exceptions.AttributeError at /file
> 'dict' object has no attribute 'filename'
>
> how can i modify my code? Eager for your help !
> Thanks very much!
it's working for me, my code looks like
class index:
def GET(self):
print render.form()
def POST(self):
i = web.input(x={})
print i.x.filename
and my form is
<form method="post" enctype="multipart/form-data">
<input type="file" name="x">
<input type="submit" value="submit">
</form>
without 'enctype' in form its not getting the filename, but its not raising
any exception
>
>
--
ashok raavi
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---