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:
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!!!