I apologise for not reading the book properly.  I have waisted many hours by
trying all sort of other stuff and in the end I could do just this:

import os
path = "/home/js/web2py/applications/uploads"  # insert the path to the
directory of interest here
dirList = os.listdir(path)
for fname in dirList:
    fn = path + fname
    stream = open(fn,'rb')
    db.wbdocuments.insert(image=db.wbdocuments.name.store(stream,fn))
db.commit()

Thanks however to all the people trying to help me.  And I have learnt about
interesting tools what might be handy in other situations.

Johann
-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

Reply via email to