Groups
Sign in
Groups
web2py-users
Conversations
Labels
About
Send feedback
Help
opening new file within controller and uploading to uploads?
20 views
uploads
Skip to first unread message
aetag...@gmail.com
unread,
May 3, 2016, 9:53:31 PM
5/3/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
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 web2py-users
I would like to open and write to a new file after accessing form variables passed from views...
I've been trying to find a similar problem, but not much luck ..
I suppose I can create another table with tempfile field of type uploads, and then do a database controller within the controller..
However I am wondering if there is an alternative way, where I just create the file object and send it to the uploads folder?
Thank you
Anthony
unread,
May 4, 2016, 12:08:58 AM
5/4/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
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 web2py-users
Check this section of the book:
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#More-on-uploads
Rather than opening an existing file, you can create a file-like object via cStringIO.
Anthony
Reply all
Reply to author
Forward
0 new messages