Thank you, that is the solution. I have changed my function to:
form=SQLFORM(db.ding, None, deletable=True, upload=URL('download'),
data={'ajax':'false'})
Now it works as expected.
2014-09-15 0:46 GMT+02:00 pn <[email protected]>:
> It is probably because you cannot upload files when ajax is enabled in
> jquery-mobile forms. There are more details at the following links on how
> to correctly structure a file upload form in jquery mobile.
>
> Quote from their docs (http://demos.jquerymobile.com/1.4.4/forms/ --
> near the bottom of the page)
>
> File Inputs + Ajax
>
> Using a multipart form with a file input is not supported by Ajax. In this
> case you should decorate the parent form with data-ajax="false" to ensure
> the form is submitted properly to the server.
>
> On Sunday, September 14, 2014 3:13:55 PM UTC-4, mweissen wrote:
>>
>> I have a very simple model
>>
>> db.define_table('ding',
>> Field('beschreibung'),
>> Field('bild','upload')
>> )
>>
>>
>> a simple function
>>
>> def snap():
>> form=SQLFORM(db.ding, None, deletable=True, upload=URL('download'))
>> if form.process().accepted:
>> response.flash="Fertig"
>> elif form.errors:
>> response.flash="Fehler"
>> return dict(form=form)
>>
>>
>> and a view
>>
>> {{#extend 'layout.html'}}
>> {{extend 'plugin_jqmobile/layout.html'}}
>> <h1>SNAP</h1>
>> {{=form}}
>>
>>
>> With layout.html everything is fine, but with plugin_jqmobile the
>> upload finishes after a second with no error message but also with no new
>> uploaded file in the database.
>>
>> Any ideas?
>> Regards Martin
>>
>>
>>
--
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.