Hi guys, I'm making a function to copy and insert a row of a database.
I want to copy and rename a file but the automatic b16 renaming becomes too
long and breaks when you make a copy of a copy.
It also breaks some of my later processing of the file.
Here is some code:
def copy():
import os
a = db.name(db.name.id== request.args(0))
filepath = os.path.join(request.folder, 'uploads', a.file)
stream = open(filepath, 'rb')
db.name.insert(title= '%s_copy' % (a.title),
file_up = db.name.file.store(stream, filepath),
--
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.