thanks for responding Martin I don't want to fight the framework and certainly prefer to adapt my approach to leverage a framework's advantages.
I can get Pyjamas to submit to default/upload Do you know a) is this bit Web2py friendly? and b) if so, then what code I should be putting in upload() instead of my low-level db.myfield.insert(...store()) ? On Sep 1, 5:44 pm, "Martin.Mulone" <mulone.mar...@gmail.com> wrote: > In my point of view i don't recommend this approach for uploading > images or files. You lost many good things of web2py in that area, > file verification and in gae you are going to have problems. You can > use an iframe for showing in another page. > > On Sep 1, 12:48 pm, Carl <carl.ro...@gmail.com> wrote: > > > > > I'm uploading a file from a html form submitted from a page built by > > "pyjamas" pyjs.org > > > Such files contain XML and I have a method on the server to parse the > > content of such files and generate rows in various tables. Such files > > are <1MB in size (probably ~50KB at most). > > > What is a good approach to use if using Web2py? I ask because the only > > examples I have found deal with image files which are not manipulated > > but 'merely' retrieved at display time. > > > One approach I started was to submit the form and then insert the XML > > file contents into a table (called queue in the code below). But... I > > can't figure out how to retrieve the XML data saved to the database > > (I'm running on GAE). > > > def upload(): > > from datetime import datetime > > now = datetime.now() > > db.queue.insert(name=request.vars.uploadFormElement.filename, > > > xml=db.queue.xml.store(request.vars.uploadFormElement.file,request.vars.upl > > oadFormElement.filename), > > processed=False, > > cDate=now, > > mDate=now) > > > Of course I wouldn't need to retrieve the data from the database if I > > could have accessed it directly in upload(). > > > Does anyone know the recommended approach to this problem set?