Hi val thanks for your answer.
Althought as you said, an absolute path is safer, a relative path as i have
in the field form, looks like it works.
I got that part covered with:
filename = form1.vars.csvfile
file = request.post_vars.csvfile.file
file.seek(0) #something is consuming the file so i gotta rewind
content = file.read()
dest = os.path.join(os.path.abspath("."), uploadfolder)
dest = os.path.join(dest, filename)
with open(dest, "wb") as f:
f.write(content)
idk why but form.vars.myfile is storing only the filename of the
automatically created file inside the upload folder.
Im reading the submitted file from request.post_vars and using
form.vars.myfile to store the content manually.
>>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.