I am surprised I couldn't find this in the queue, and hope I'm not missing something obvious.

I want to use IMCE for basic file management, allowing other users to upload new versions of their Word documents, etc. Of course, there are links throughout our site to these documents, so new uploads should keep the existing name. I don't want anything done in error, so I would like to rename existing (or otherwise ask the user if they want to really replace existing). I know this is lacking in core as well (see http://drupal.org/project/upload_replace, which doesn't seem to help IMCE any).

So at a minimum, I'd love to see one more option ("Rename the existing file.")under "Default behaviour for existing files during file uploads:". In an ideal world, also allow the user to specify at the time of upload.

#3 imce-rename-existing-572938-3.patch3.92 KBBrockBoland


ufku’s picture

Status:Active» Closed (fixed)

Closing 6.x-1.x issues as this branch is no more supported.

Rory’s picture

Version:6.x-1.2» 7.x-1.x-dev
Status:Closed (fixed)» Active

Agreeing with @seattlehimay, this would be very nice for 7.x!

BrockBoland’s picture

Issue summary:View changes
Status:Active» Needs review
new3.92 KB

Patch attached for review. The new 'Rename the existing file' option works much like upload_replace, in terms of numbering.

The main problem at this point is the same one discussed in #616932: Refresh picture in files browser after upload: the browser typically caches the original image, so even after uploading a replacement, the user still sees the old image in the IMCE interface and their WYSIWYG editor. I'm not sure how to address this. The technique mentioned in comment #2 on that issue will bust the cache in the IMCE window, but not in the WYSIWYG editor or the actual node view. It's likely that the user would perceive this option as being broken, since it would appear that way to them.

nico.knaepen’s picture

I've added a patch for 7.x-1.x that gives the possibility to let the user decide wich behaviour to apply on the uploaded files.

naiptol’s picture

I need similar functionality too. When my site users overwrite files, old files should be renamed with timestamp in filename and moved to special directory (directories are different for different node types). I did it in 6.x version by inserting my own function (i know it's wrong way, but could not find better). Now I'm moving this project to 7.x, and have the same problem.

Could you, please add :
module_invoke_all('imce_submit', $imce);
in function imce_upload_submit ?

I would be able to do all that copying from my module call.