db.define_table('plugin_upload_file',
auth.signature,
Field('title', 'string'),
Field('description', 'text'),
Field('upload_file', 'upload'),
Field('table_name', 'string'),
Field('record_id', 'integer'),
format = '%(title)s'
)
def index():
table_name = request.args(0)
record_id = request.args(1, cast=long)
## pre-fill the table_name and record_id
db.plugin_upload_file.table_name.default = table_name
db.plugin_upload_file.record_id.default = record_id
plugin_upload_file_form = SQLFORM(db.plugin_upload_file).process()
if plugin_upload_file_form.accepted:
response.flash=T('File saved')
redirect(URL('index', args=(table_name, record_id)))
else:
response.flash=T('Error')
return locals()
{{=plugin_upload_file_form}}
{{=LOAD('plugin_upload_file', 'index', args=('item', item_id), user_signature=True)}}
It works when I directly access the index page, however when I LOAD it to other pages it stops working. No ticket, no error.
{{=LOAD('plugin_upload_file', 'index', args=('item', item_id), user_signature=True)}}
Any idea?
maybe it could help: http://www.web2py.com/books/default/chapter/29/12/components-and-plugins#Ajax-post-does-not-support-multipart-forms
From a vary fast reading I think it's just about a case like
yours...
M.