You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cherrypy-users
Hi all.
I'm working on a small webapp with cherrypy that read an uploaded CSV
file and transform it in XML.
Now my problem is that when I try to read the content of the uploaded
file with csv.reader the file seams to be empty, but when I look at
the content with myFile.file.read() I can see the expected content.
So how can I use the csv module to read and uploaded file?
Thanks in advance.
Here is the relevant part of the code (mostly taken from the
tutorial).
def upload(self, myFile):
out = """<html>
<body>
%s
</body>
</html>"""
csvfile = csv.reader(myFile.file) # when I look in th csvfile
it seams there are no rows
content = myFile.file.read() # here I can see the
expected content