I think you haven't from.process()
form=SQLFORM()  # or SQLFORM.factory   - just  makes a set of 
html-like-component (set of DIV(), INPUT() and so on)
form.process() - filters and fills form with request.vars, does validation 
 and so on



On Friday, February 12, 2016 at 2:50:14 AM UTC+3, Alfonso Serra wrote:
>
> 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.csvfile 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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to