Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When a filefield widget is left empty it will produce an error such as:
The selected file /var/www could not be copied.
Extra validation of the filefield is needed to prevent an empty field from being processed.
Comment | File | Size | Author |
---|---|---|---|
#13 | 288416_11.patch | 558 bytes | msonnabaum |
#11 | 288416_11.patch | 566 bytes | sammys |
Comments
Comment #1
Deciphered CreditAttribution: Deciphered commentedFix committed
Comment #2
delapohl CreditAttribution: delapohl commentedI am experiencing this issue with v6.x-1.4.
Comment #3
pimousse98 CreditAttribution: pimousse98 commentedSame here, but the field is not empty. It is happening while using swfupload, so it actually handles multiple files.
Comment #4
jbenjamin CreditAttribution: jbenjamin commentedExperiencing the same issue using the filefield_paths-6.x-1.x-dev version. An empty field seems to cause the error, and no files are uploaded.
report shows "FileField Paths failed to move file () to (REG/.)." This is the one upload slot not used (there are three filefield cck fields in the content type.)
moved to active, since the new(er) post may not have been noticed.
Comment #5
jbenjamin CreditAttribution: jbenjamin commentedComment #6
kunago CreditAttribution: kunago commentedI have recently discovered the same error on my system - if I leave a filefield field empty, I get this error from Drupal. So far I have not been successful in fixing this issue.
Comment #7
kunago CreditAttribution: kunago commentedI came up with a workaround that fixes the issue for me. In 'filefield_paths.module', on the first line in the function 'filefield_paths_filefield_paths_process_file' replace this line
with this one
Comment #8
homoludens CreditAttribution: homoludens commentedThis problem still exists (and is getting very old), and fix provided in #7 fixes it.
Comment #9
Deciphered CreditAttribution: Deciphered commentedI am currently in the process of re-writing FileField Paths for a 2.x release, this issue will be resolved in that release.
Cheers,
Deciphered.
Comment #10
Deciphered CreditAttribution: Deciphered commentedTagging
Comment #11
sammys CreditAttribution: sammys commentedHere's a patch for those that need it. It applies to 6.x-1.4.
Comment #12
sgabe CreditAttribution: sgabe commentedI just encountered this error and the patch in #11 solved the problem.
Comment #13
msonnabaum CreditAttribution: msonnabaum commentedPatch looks good although it wouldn't apply for me because it had carriage returns.
Attached patch applies cleanly.
Comment #14
MXTSubscribing.
Comment #15
dman CreditAttribution: dman commentedI'm getting this. Lost ages tracing it down to here (was deep in some huge imports where 20 other files were being moved around for other reasons, and I always blame my own recently-modified code first)
Yeah #13 looks like the answer
Comment #16
crea CreditAttribution: crea commentedSubs
Comment #17
parasolx CreditAttribution: parasolx commented#13 fixed for me also. This solution already long time ago under this discussion but never commit into project.
I put this issue as fixed and hopefully it will commit in next release cause this is second time for me to do a manual fixing.
Comment #18
sgabe CreditAttribution: sgabe commentedThe issue is fixed only when the solution is committed!
Comment #19
h0tw1r3 CreditAttribution: h0tw1r3 commentedCommitted to 6.x-1.x branch.
Comment #20
roball CreditAttribution: roball commentedThe fix is now officially available in version 6.x-1.5.