hey Mark,

Thanks for the module! It's well-commented, so I'm going to try using it as a starting point for what I want to do.

As I continue to try and puzzle out the code (I'm new to module development), one thing in your comments made me a little confused. Your notes say that the default behavior with a file replacement is to append the _0 to the filename, but I'm not seeing this exact behavior. I wouldn't be writing this if I did, because that's what I want to happen! :)

The behavior I'm observing with FileField are as follows:

Given that user has uploaded filename.doc through a filefield on node/1

#1 - User uploads filename.doc to node/2, filename.doc is renamed to filename_0.doc
#2 - User uploads filename2.doc to node/1, at which point filename.doc is removed and deleted

your module adds an additional behavior
#3 - User uploads filename2.doc to node/1, this file is renamed to filename.doc and the existing filename.doc is renamed to filename_0.doc.

I am looking to achieve
#4 - User uploads filename300.doc to node/1, and filename.doc is not deleted (and if the user uploads filename.doc, that new file is renamed to filename_0.doc)

Reading up on FileField, I can see why filename.doc, being no longer attached to a node, is deleted. I'm trying to find an easy way to circumvent the delete process so that the files remain on the server, even without an fid (for access through IMCE, etc).

Another approach to take would be to use FileField Sources to reference files from a file browser, but in order for those to be used with FileField they need an fid. Is there a way to import files and give them an fid without them being associated with a node? I'll have to read up on that...

Sorry for rambling! Any insights would be appreciated.

Comments

elijah lynn’s picture

Status: Active » Closed (outdated)

Let's close this for now as this issue is over 6 years old and is asking for advice from the original maintainer who doesn't appear to be involved anymore. If you still need this answered feel free to reopen it.