This took me a little while to figure out, so it may help someone else. I wanted to add images that I had FTP'ed to my server, but initially found that Filefield sources was moving them elsewhere. This is the how to attach images directly from your specified directory:

  • Filefield sources looks for images specified in CCK Filefield sources | File attached settings, in the directory specified in "File attach path". Initially it is set to file_attach, which I changed to "images" a directory in my /files folder. I also set "File attach location" to "Within the files directory", and "Attach method" to "Leave a copy of the file in the attach directory"

  • Filefield sources moves files to the location specified in FileField Path settings, in "File path". This should match the directory in "File attach path", above.

It would be useful if "Move the file directly to the final location" mentioned (a) where this is current pointing to (b) that it can be changed in "FileField Path settings"

Comments

timgilmour’s picture

maybe i'm missing something, but this doesn't work as i would think it does. i have all the settings set the way you do, and what the module is doing is duplicating the file, appending a number to it, and then linking to that file, as opposed to the original uploaded one. this causes problems, as what ends up happening is that everytime the node is changed, it generates another duplicate. this results in a bunch of extraneous file duplicates in the file attach directory, and the select list for file attach having a ton of the same entries with _0 _1 _2 etc appended to the filename. the system is also deleting the original file if it's removed.

it would make more sense to me if the module had a check in it to see if the filefield path is identical to the file attach path, in which case to not do any file duplication, and link directly to the file itself (and not remove it if the attach is removed from the node).

tescometro’s picture

Yes, this giving me some problems too. Module works great (thankyou, its working well with wysiwyg fields too), and I can still use it, but like the previous poster, I'm using the same path for the filefield and the file attach, which makes sense for a tidier server in some circumstances. but instead of reusing the same file, it creates the copy each time. Maybe it could have a third option in "attach method" section that allows for single folder use without copying...

SeanA’s picture

Category: support » feature

Yes, this is unexpected behavior. I just want to use the exising image without moving it or creating a copy of it!

-edit- I suppose the problem with not making a copy is if the image or field is deleted from one node, it will disappear from all nodes it is attached to.

SeanA’s picture

OK, it looks like the way to re-use images is to use the 'Autocomplete reference textfield' method. What I'd like is a nice user-friendly drop-down list instead of the autocomplete thingy (which is confusing and ugly). I will work on this if/when it starts to bug me enough.

trickyricky26’s picture

I installed this awesome module in order to link large (>2gb) files to filefields but I think I found a limitation.

warning: filesize() [function.filesize]: stat failed for ../.. in /home/../public_html/sites/all/modules/filefield/field_file.inc on line 155.
The selected file /home/../public_html/.....mov could not be copied.

On linux 32-bit this error will occur for files that are larger than 2GB because the module is trying to copy the file (which fails to retrieve the filesize over 2gb) to the correct folder instead of just linking it.

Could we add a third option to "link" instead of move?

Similar requests here:
#1397744: Don't copy an already FTPd file when attaching to a nodes. Just link it.
#1144802: Add an additional option for handling files

BioALIEN’s picture

Status: Active » Closed (won't fix)