auth_user_table = db.define_table(
    ... the usual suspects ...
    Field('avatar', 'upload', ondelete='CASCADE', ...)
    )

Using the auth.profile() routine, if user uploads a profile picture, it 
properly appears under the uploads directory. However, if user uploads a 
new profile picture, the new picture duly gets uploaded but the old one 
remains. It is now an orphan file. IMHO, the old profile pic should get 
deleted when the new one takes its place. Otherwise, if you have a lot of 
users and people change their profile pics frequently, you're going to end 
up with a lot of orphaned files taking up disk space unnecessarily.

I will submit this as a web2py ticket if it's considered a bug. As a 
feature, I think it's only useful to Seagate and WD. ;-)

Reply via email to