Supposing one has a controller like this:

def mycustomstore(f, n, p):
    print "file length", len(f.read())
    print "file name", n
    print "path", p

def index():
    form = SQLFORM.factory(Field("myupload", "upload",                     
            custom_store=mycustomstore))
    if form.process().accepted:
        pass
    return dict(form=form)


Running in a welcome app and a linux machine with the rocket builtin server 
(web2py Version 2.7.4-stable+timestamp.2013.10.19.17.40.27)

When one submits the form specifying a file, the form passes validation and 
it is possible to store the file output elswhere or, for example use it as 
custom field input for a custom db interface (which is the way I'd use such 
code). Now, it seems that with this configuration, the upload feature does 
not keep a copy of the file in the filesystem (not within the application 
path afaik).

Is this the correct way of submitting file data without file storage with 
web2py? I belive this feature is not documented. Would this also work on an 
environment without write access to the file system (for example appengine)?

-- 
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/groups/opt_out.

Reply via email to