HI
db.define_table('logos',
Field('logo', 'upload', uploadfolder='applications/%s/%s' % (request.application, 'uploads'), uploadseparate=True, autodelete=True),
Field('thumbnail', 'upload', uploadfolder='applications/%s/%s' % (request.application, 'uploads'), uploadseparate=True, autodelete=True, compute = lambda row: thumb(row.logo, 90, 90, 'logos.logo')),
)
path = '%suploads/%s/%s/%s' % (request.folder, where, image[start:end], image)
"where" depends on the field and table names, table logos and field logo
and thumb is a module for getting a thumbnail of the picture
def thumb(
from gluon import current
import os
from PIL import Image
request = current.request
start = len(where)+1
end = len(where)+3
img = Image.open('%suploads/%s/%s/%s' % (request.folder, where, image[start:end], image))
img.thumbnail((nx, ny), Image.ANTIALIAS)
root, ext = os.path.splitext(image)
thumb = '%s_%s_%sx%s%s' % (root, name, nx, ny, ext)
img.save('%suploads/%s/%s/%s' % (request.folder, where, image[start:end], thumb))
#~ print 'thumb', thumb
return thumb
Regards