|
Wim Heirman
Wim.Heirman at UGent.be
Mon Oct 17 09:53:21 EDT 2005
> Thanks for your answer.
> Now I have a next question.
>
> If I run my script I get the following message:
> ...............
> ..............
> File "C:\Program Files\Python24\Lib\site-packages\mod_python\util.py",
> line 70, in __getattr__
> raise AttributeError, name
>
> AttributeError: read
>
> I print my file and this is the result:
>
> Field('file', 'TESTTESTTEST')
>
> I need the second TESTTESTTEST …..
> I don’t going to replace or split it!
>
> Why in this format ……..Field(‘file’,’TEST……’)?
>
> My script:
>
> <html>
> <%=file%>
> <%
> def getFile(file):
> if file is None: # There was no file sent.
> return "Error! There was no file!"
> if type(file) is str:
> # File was sent as a regular field, which is bad.
> return "Error! File was a string!"
> fileData = file.read() # Get the file data into a Python variable.
> req.write("DONE")
> return "Ok, file received."
>
> getFile(file)
> %>
> </html>
Sorry, I don't see what's wrong. Maybe you could post your complete
code, and the whole traceback instead of just the last line?
Or maybe someone else on mod_python can help you (you didn't seem to
have used "reply all", the list wasn't in cc when I got this)
> ====
> other question how can I reply to the answers on mod_python mailinglist.
> Because if I reply. My Reply become a head question not a sub answer of
> the topic?
All your mails are threaded nicely here (thunderbird), just replying to
the message (not composing a new one and copying the subject) should
work fine in any descent mailer
Regards,
Wim.
--
ir. Wim Heirman,
ELIS Department, Ghent University, Belgium
Phone: +32-9-264.95.27
E-mail: wim.heirman at elis.UGent.be
http://www.elis.UGent.be/~wheirman/
|