thanks Rowdy I was looking for exactly this kind of advice :)

import glob
for filename in glob.glob('/path/to/files/*'):
 
db.yourtable.insert(yourfield=db.yourtable.yourfield.store(open(filename,'rb')))

writing my own download function would work but it would break future
uploads which should be done in the save and proper web2py way

I guess these lines should be somewhere in the book. The advice for
legacy database so far is not enough.
maybe extend 6.4. -> Legacy Databases?

On Apr 15, 12:21 am, Rowdy <da...@fielden.com.au> wrote:
> selecta wrote:
> > I am currently migrating a legacy db (mysql) to web2py. I have written
> > some tooling that I will share as soon as I'm done (e.g. some code to
> > convert phpmyadmin exports of sql table creates to web2py code)
>
> > Right now I am dealing with the file uploads from the legacy db. What
> > I have done so far is to copy the filenames from the legacy db into
> > fields of type "upload" and put the files into the uploads folder.
> > However this does not seem to be enough to make the files downloadable
> > with the download function.
> > What is the proper way to deal with that?
>
> Greetings,
>
> This solution worked well for me:
>
> http://osdir.com/ml/web2py/2010-02/msg01577.html
>
> Rowdy


-- 
To unsubscribe, reply using "remove me" as the subject.

Reply via email to