I have a content type with a file field added, and there are times when I would like the file field to point at a file I have already uploaded. For example, I might have two different nodes which have the same associated file, and when creating the second node, I would like to have the file field simply point at the file I uploaded for the first node. I could just upload the file a second time, having something like filename.ext and filename-0.ext, but I would prefer to avoid the duplication. Also, some of the files I want to have attached to my nodes are larger than my host's upload limits permit; I can ftp them to the desired place in my directory, but I can't upload them in Drupal, so I can't even get the file field to point at them in the first place. Right now, the best solution I can come up with is to add an optional link field, which has the same human-readable label as the file field, and is used when I want to point at an already-uploaded file. However, I'd prefer if I could get both kinds of functionality in a single field, in case I want to use the file field in a View or something like that.
Comments
Comment #1
shittii commentedThis something I'm definitely after too! Especially now that I'm using this method http://drupal.org/node/189239 to control user access. Subscribing...
Comment #2
jpetso commentedRe-marking as "feature request". Valid, but difficult to implement. Any help on coding this stuff is appreciated.
Comment #3
drewish commentedsubscribing and bumping to HEAD since it seems like something that'd have to happen there and be back ported.
Comment #4
ar-jan commenteddopry, do you have plans to work on this, or is it something you would not implement?
Comment #5
dopry commentedIt's already implemented in the latest FileField HEAD, there is no UI yet.
Comment #6
strellman commentedI am also interested in this. For mp3 and other media files it seems like many people would want to ftp them to the site because it is a more reliable way to upload large files. We also have a large existing mp3 library and want to just create nodes that reference them and play them. For other people with existing media libraries see http://drupal.org/node/133705
This looks like a common problem as folks want to move to D6 and the audio module is not working. It gives us good motivation to switch to CCK and FILEFIELD.
When you say "already implemented", is this the extensible file type?
Is there a work around, another way to create these nodes without uploading the files?
If there is no user interface, why is this issue closed? Is there another place to subscribe?
Comment #7
ipto commentedWould do well to also be able to cancel the automatic renaming when loading a file with an existing name. Now if the tether is named file.txt, then downloading file with the same name, he renamed the file_0.txt, but often useful to simply replace the existing file
found answer: file should remain marked as 'temporary' and be automatically deleted during the next cron run after a predefined amount of time has passed
cron delete my file file_0.txt with status=0
Comment #8
tyromind commentedI don't think a feature can be marked as complete if there's no way to use it...
Comment #9
dopry commented@tyromind: I'm leaving the UI to be implemented outside of filefield and just providing the supporting infrastructure... There are some issues that need to be resolved else where in drupal before it is a usable solution. access control and deletion comes to mind first... but the field module does support it even though a widget hasn't been introduced to enable it yet. I'm leaving it as closed... I hope you don't mind... You can open a feature request for a file browser ui... I already work with shared files programmatically.
Comment #10
servantleader commentedWhether it will be difficult or not, if this feature is available out of the box, FileField will be a much more valuable module. If the user must jump through hoops, or write custom code, what good is the code that we have developed?
Comment #11
Anonymous (not verified) commentedI agree that this would be a very valuable enhancement, if available out of the box.
I wish to attach the same uploaded document to more than one node on the site, and can't find any reasonable way of doing it. If I make editors upload the same document twice I will guarantee that we end up with two different versions before I can turn round. This will cause confusion to the end users.
It seems such a common requirement - is there some other way of doing this that I have missed?
---------------
A thought on the Access Control / Deletion issues:
Have two different field types:
1. Filefield as now.
2. A field which cross refers to a Filefield on another node. When rendered this would look like the original, but when invoked the code would first access the target node, then retrieve the Filefield content. If the user did not have access to the target node, then return access failure. If the original has been deleted in the meantime then get "Node not found2 error.
This separates the responsibilities for maintaining the uploaded file from the person who wants to reuse it. It is a people process question to keep them in step.
Regards, Tony.
Comment #12
quicksketchThere is an in-progress module in the ImageField queue for this feature. See #119539: FileField Sources: Remote files / Reference existing files. Please do not post further comments here.
Comment #13
quicksketchPlease try out http://drupal.org/project/filefield_sources and post any new issues to that project's queue.