use Field('image', 'upload', autodelete=True)
On Tuesday, July 23, 2013 10:18:24 PM UTC+2, [email protected] wrote:
>
> i am making a product app in web2py everything is working really well
> exept one thing.
>
> i upload the images like this:
>
> the_image = db.product_images.image.store(request.vars.image.file,
> request.vars.image.filename)
> img_id = db.product_images.insert(product_id=p_id ,
> image=the_image , main_image=True)
>
> that work awesome, it stores the image in the uploads folder.
> now the problem is when i try to delete a image it only deletes the
> database record, and not the image itself stored in the uploads folder
>
> this is how i delete my current image:
>
> db(db.product_images.id == img_id).delete()
>
> i want to know how can i delete the image and not only the record so i
> dont store that amazing ammount of unused images in the server.
>
> Txn for your help!!!
>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.