Got it thanks.
Strange; I am almost certain that I had it working at some point;
perhaps I am mistaken.
Thanks for the heads up.
On 7/1/11 10:03 AM, Anthony wrote:
Assuming you have ajax=True in LOAD(), I think file uploads will not
work without some special setup. According to the book:
/*Please note:* 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, uploads are done
with ajax-compatible 3rd-party widgets and web2py manual upload
store commands./
Anthony
On Friday, July 1, 2011 9:34:33 AM UTC-4, David J wrote:
I had this working a few weeks ago.
I have an upload form which I load into the page using the LOAD
helper.
Right now I get an exception when I try to upload.
Here is the code.
def upload_contacts():
form = FORM(INPUT(_type='file',
_name='data',requires=[IS_NOT_EMPTY()]), INPUT(_type='submit'))
if form.accepts(request):
contact_list = request.vars.data #I also tried
form.vars.data.file Exception about data being a string.
...csv processing left out for brevity
I am just trying to access the file at this point.
I followed the example in the book in DAL for uploading CSV data.
http://web2py.com/book/default/chapter/06#CSV-%28one-table-at-a-time%29
<http://web2py.com/book/default/chapter/06#CSV-%28one-table-at-a-time%29>