I have a content type with multiple filefield_sources fields, and each has its own destination folde specified. When the name is, say, "grants/rfp", filefield_sources retrieves the file from out on the web just fine, but the destination path stored is site root + tmp folder path. I am not sure whether the file gets moved at all- it appears it does not. If i rename "grants/rfp" to "grants-rfp" then the process works, but the destination path is ignored and the file is placed under sites/default/files.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | filefield_sources_checkdir-d6.patch | 2.59 KB | quicksketch |
| #7 | filefield_sources_checkdir-d7.patch | 4.4 KB | quicksketch |
| #6 | 901278.patch | 1.93 KB | brianfisher |
Comments
Comment #1
quicksketchWhat server software are you running (OS, web server) and is your files directory writable? It sounds like FileField Sources can't create the directories in file directory.
EDIT: Ah, looks like this is duplicate of #881444: Troubleshooting why remote fetch works locally but not remotely on staging. Marking fixed.
Comment #2
texas-bronius commentedTo reproduce and confirm that it's only filefield_sources and not filefield or file system permissions:
Temporary workaround: make sure your filefield custom paths exist before using filefield_sources to grab files off the web.
Comment #3
capsicumpie commentedI think I have a similar problem. Under 'path settings' I've set the file path to contain subfolders based on tokens. However, no subfolders are ever created, despite the permissions on the designated base folder being fully writable.
In further testing I just tried static subfolder names and noted the following behaviour:
Comment #4
soup1977 commentedI'm having this issue as well. Just a regular old upload works fine and creates the correct directory structure. But when I use the Remote URL option. It doesn't work and puts it somewhere?
Comment #5
texas-bronius commentedSo, from the outside looking in, it looks like it would be helpful if fieldfield_sources would create the destination folder if the specified path does not yet exist, just like fieldfield already does.
I'll be honest.. I spot-perused both fieldfield and fieldfield_sources code and didn't come up with the difference I think I am looking for :)
Comment #6
brianfisher commentedThis is a problem for both remote and attach sources, field_file_save_file() doesn't recursively create directories.
http://drupal.org/node/440574
so I've added a call to field_file_check_directory() as suggested in the attached patch (for 6.x-1.2)
Comment #7
quicksketchI've committed these patches to add this functionality. Thanks @tbfisher.