http://web2py.com/books/default/chapter/29/12?search=uploads
*Because Ajax post does not support multipart forms, i.e. file uploads,
upload fields will not work with the LOAD component. You could be fooled
into thinking it would work because upload fields will function normally if
POST is done from the individual component's .load view. Instead, uploadsare
done with ajax-compatible 3rd-party widgets and web2py manual upload
store commands.
*
On Thursday, April 25, 2013 5:58:07 AM UTC+2, software.ted wrote:
>
> I have experimented with this and i think there is something wrong...
>
> *Controllers*:
>
> def index():
> return locals()
> def post():
> form = SQLFORM(db.pics, upload=URL('download'))
> if form.process().accepted:
> response.flash = 'Data saved'
> elif form.process().accepted:
> response.flash = 'Error with form'
> return dict(form=form)
> def download():
> return response.download(request, db)
>
> Views:
>
> View-
> -albums
> + index.html
>
> {{extend 'layout.html'}}
>
> {{=A('Upload Picture', component=URL('album','post.load'),
> target='photo-space', _class='btn')}}
> <div id="photo-space"></div>
>
> + post.load
>
> {{=form}}
>
> The funny thing is when if i access the post normally and not as a
> component the file is being uploaded and but as a component as shown in the
> code above, the image is not being uploaded and the database field for
> image is empty but the name of the picture is added.
>
> Any thought on this or its by design that its not working!?
>
>
> --
>
> .......................................................................................
> Teddy Lubasi Nyambe
> Opensource Zambia
> Lusaka, ZAMBIA
>
> Cell: +260 97 7760473
> website: http://www.opensource.org.zm
>
> ~/
> Human Knowledge belongs to the world! - AntiTrust
>
> Man is a tool-using animal. Without tools he is nothing, with tools he is
> all - Thomas Carlyle 1795-1881
>
> /~
>
--
---
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/groups/opt_out.