I have tried it on GAE, but it looks like it uses the gallery table instead of the gallery_images table, so the uploaded files are not redirected to the other db table.
On Oct 1, 9:58 pm, István Gazsi <[email protected]> wrote: > It's great now it works! :) Thank you very much. I will test it on GAE > as soon as I can and I'll post the results here. > > Have a nice day! > > István > > On Oct 1, 9:18 pm, mdipierro <[email protected]> wrote: > > > > > > > > > Now I think I fixed it. This time I tried it. Please double check. > > Notice you can have a single table with all your files and more than > > one record from different tables use that as uploadfield. > > > Massimo > > > On Oct 1, 1:29 pm, István Gazsi <[email protected]> wrote: > > > > I've made a little mistake, because I added the uploadfield option to > > > another field, but it didn't cause any problem. But it looks like when > > > I upload a file into the redirected field (the one with the > > > uploadfield option) web2py still doesn't create a new record in the > > > gallery_images table, and it can't load the image later. Here is the > > > traceback: > > > > Traceback (most recent call last): > > > File "/home/istvan/Documents/Mercurial/web2py-trunk-test/gluon/ > > > restricted.py", line 188, in restricted > > > exec ccode in environment > > > File "/home/istvan/Documents/Mercurial/web2py-trunk-test/ > > > applications/init/controllers/gallery.py", line 90, in <module> > > > File "/home/istvan/Documents/Mercurial/web2py-trunk-test/gluon/ > > > globals.py", line 96, in <lambda> > > > self._caller = lambda f: f() > > > File "/home/istvan/Documents/Mercurial/web2py-trunk-test/ > > > applications/init/controllers/gallery.py", line 88, in download > > > return response.download(request,db,attachment=False) > > > File "/home/istvan/Documents/Mercurial/web2py-trunk-test/gluon/ > > > globals.py", line 196, in download > > > (filename, stream) = field.retrieve(name) > > > File "/home/istvan/Documents/Mercurial/web2py-trunk-test/gluon/ > > > sql.py", line 2865, in retrieve > > > data = self.uploadfield._table(query)[blob_uploadfield_name] > > > TypeError: 'NoneType' object is unsubscriptable > > > > And I'm really thankful for your hard work and help. :) > > > > István > > > > On Oct 1, 8:05 pm, mdipierro <[email protected]> wrote: > > > > > one more try please > > > > > On Oct 1, 11:52 am, István Gazsi <[email protected]> wrote: > > > > > > I forgot to mention that I inserted a record into the gallery table. > > > > > :)

