I have found that the behavior described in the module description is not quite right when used with filefield/CCK. When you remove a filefield file and uplaod a new version, the old file is completely removed and replaced.

This behavior is fine in my case, but it might be helpful to document the difference in case other users are expecting the file_0, file_1 behavior for archival reasons. My assumption is that the behavior described works with the core Upload module?

Thanks for the great little utility module!

Comments

markDrupal’s picture

From what you say it sounds like you are using the "Upload" module? This module(upload_replace) will not do anything for the upload module. It only works with filefield uploads. (until Drupal 7)

It depends on 2 hooks in the filefield module "file_update" and "file_delete".

The other issue you might be running into is lack of "node revisioning". If you have sufficient permissions, the admin user does, you will see a check box in the node edit form labeled " Create new revision".

If you have that box checked and replace a file, the old version of the file will remain. At least it does for me, as I have multiple version of a file on my webserver. The older files don't get removed.

Let me know how it is working for you.

markDrupal’s picture

Status: Needs review » Postponed (maintainer needs more info)
markDrupal’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

Sounds like you need to enable "node revisioning" to allow for multiple versions of the same node.

jason.bell’s picture

Thanks. Sorry I didn't get notification of your previous response here and see now what you describe.

minhtao’s picture

It partially works when you invoke the update hook fron the upload module . :)

minhtao’s picture

Actually, have you tried to upload the same file several times and then delete the latest one (the one that actually have the real name)? I think that creates a bug.

Like:The selected file [filename = ''] could not be copied, because no file by that name exists. Please check that you supplied the correct filename.