Hi,
I've installed the web2py_ckeditor plugin from:
https://github.com/timrichardson/web2py_ckeditor4/releases
I think this will working really nicely for providing a table of simple
blog posts, but I'd like to control where uploaded files get stored. I had
a look at the source and it seemed like ckeditor.settings.uploadfs might be
the answer, but I can't get it to work. Everything just gets stores in the
root of app/uploads.
In an ideal world, I'd like to able to modify this in different controllers
so that uploads for 'blog' posts go to one folder and uploads for 'news'
posts go to another.
Cheers,
David
*db tables*
from plugin_ckeditor import CKEditor
ckeditor = CKEditor(db)
ckeditor.define_tables()
db.define_table('blog_posts',
Field('authors', 'string'),
Field('title', 'string'),
Field('content', 'text', widget=ckeditor.widget))
*controller*
def new_blog_post():
# set where the controller is going to save uploads
ckeditor.settings.uploadfs = 'uploads/blog'
form = SQLFORM(db.blog_posts)
if form.process().accepted:
response.flash = CENTER(B('Blog post submitted.'), _style='color:
green')
else:
response.flash = CENTER(B('Problems.'), _style='color: red')
return dict(form=form)
--
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.