1234567891011121314151617181920212223 |
- def upload():
- (new_filename, old_filename, length,
- mime_type) = current.plugin_ckeditor.handle_upload()
-
- title = os.path.splitext(old_filename)[0]
-
- result = current.plugin_ckeditor.settings.table_upload.validate_and_insert(
- title=title,
- filename=old_filename,
- upload=new_filename,
- flength=length,
- mime_type=mime_type
- )
-
- text = ''
- url = URL(*current.plugin_ckeditor.settings.download_url,
- args=[new_filename])
-
- if not result.id:
- text = result.errors
- return dict(text=text, cknum=request.vars.CKEditorFuncNum, url=url)
-
|