I have been waiting for the filefield module to remove an uploaded image from the server, when removed using imagefield. This has been a request within the imagefield issues for about a month now: http://drupal.org/node/353367 but it was realized that filefield was where the request should have initially been placed.

The problem has been seen using Imagefield, so I am guessing it affects other areas, but I have only tested with ImageField.

Now for the problem:
When an image is added using IF, if a file is added and removed within the same "session" of editing a node, the file is NOT removed from a server. The only way it is removed is if the image is added -> node saved -> node edit -> image removed -> node saved

Let me know if I need more explanation to the problem.

Comments

dopry’s picture

Status: Active » Postponed (maintainer needs more info)

Are those files flagged as permanent? If they're not permanent cron will clean them up later... This is somewhat intentional behavior in case you upload something, remove it, and decide you want it later.. It's still on the server... the UI for this isn't in place, but cron should delete the file as long as the status in the files table is 0.

dopry’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

I just confirmed the status is 0 if it's not saved on the node. Ie uploaded and removed with out being saved on the node.

philsward’s picture

I just tested the process of uploading an image, then removing it (original is saved to server) then uploading a second image in it's place and saving the node. Even after doing a cron run, the original image is still on the server. (I now have 2 images on the server instead of one image. Well, 4 total including the generated thumb images...)

Am I doing something wrong?

johnpitcairn’s picture

Subscribing. I'm experiencing similar issues, replaced files (images, PDFs, whatever) are not getting cleaned up at the next cron run.