Il 31/03/2011 12:46, Manuele Pesenti ha scritto:
Hi *,
is there a way to modify the file name with whom a file is stored in the filesystem using an upload field? I tryied in this way but without success:

this answer to my quest thankyou anyway :)

http://groups.google.com/group/web2py/browse_thread/thread/b04977ace137b317/f4c3e44b4cd5de6d?lnk=gst&q=Change+upload+behaviour#f4c3e44b4cd5de6d


<cited text>
[web2py] Re: Change upload behaviour: standard filename

Massimo Di Pierro
Mon, 17 Jan 2011 09:09:17 -0800

You can pass two optional arguments to Field(...)

custom_store  and custom_retrieve

the first must be a function that takes a file like object, a
filename, and an optional path (uploadfolder) stores the file where
you like and returns the filename you assign to the file (can be the
original one)

custom_retrieve instead takes a filename and a path (uploadfolder) and
return the file content.

Massimo
</cited text>

Reply via email to