Hi,

I have a content type with a single-valued filefield field.

When I create a node, things work as expected.

When I edit that node, and change the uploaded file, the new file takes effect as expected. However, the previous file remains in {files} and the filesystem.

This occurred both with:

o Clicking the 'Upload' ajax button and then 'Submit', and
o Clicking 'Submit' on it's own.

I had a quick look in the code . . . it seems there's no tracking of what the previous file is, so there's no way to decide whether to delete it.

If the filefield field is single valued, one could argue that uploading a new file should delete the previous one. However, this picture gets complicated if the filefield field is multi-valued.

Thoughts and discussion welcome.

Thank you.

Comments

drewish’s picture

Status: Active » Closed (duplicate)