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.
Whenever I attempt to use file upload, I get the following error:
Exception: Resource is not a file or it is an empty directory: in FeedsFileFetcher->fetch() (line 67 of feeds/plugins/FeedsFileFetcher.inc).
the line is:
throw new Exception(t('Resource is not a file or it is an empty directory: %source', array('%source' => $source_config['source'])));
the array result is:
[FeedsFileFetcher] => Array ( [fid] => [source] => [upload] => )
Comments
Comment #1
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedcaused by patch here: https://drupal.org/node/1127696
Comment #2
GuyPaddock CreditAttribution: GuyPaddock at RedBottle Design, LLC for House at Work commented@SocialNicheGuru: Your comment literally makes no sense. I've reviewed the other issue and there's nothing to indicate they're related.
I'm seeing this issue when running the latest version of Feeds on Acquia Dev Desktop. I have verified that the File Fetcher settings and Drupal File system settings are configured correctly.
This issue completely blocks the ability to do CSV imports.
Here's an export of my importer:
Comment #3
MegaChriz CreditAttribution: MegaChriz as a volunteer commented@GuyPaddock
I tried your importer, got a lot of missing targets (even after installing profile2 module and adding fields to a profile entity) so I removed these. Then downloaded the CSV template, added an item to it and imported that. Result: "Created 1 user."
Can it be that the file permissions of the folder are not correct? If they are correct, can you provide the steps to reproduce the issue? Now it looks like something related to profile2 is involved.
Comment #4
qproSimilar here (debian 8.3, drupal 7.43, Feeds 7.x-2.0-beta2),
I am able to import a file indicating file name (public://feeds/filename.xml), but If I don't set the file name (public://feeds/ or public://feeds) I get "Resource is not a file or it is an empty directory"
Comment #5
MegaChriz CreditAttribution: MegaChriz at WebCoo commented@qpro
I tried to reproduce your issue this way:
Result: Created 1 node.
Can you provide the full steps to reproduce the issue? Also, it seems your settings are different from what is reported in #2 where the option "Supply path to file or directory directly." was not enabled.
If the issue occurs even if you keep the importer settings as much to the defaults as possible, try if you can reproduce the issue on a fresh install.
Comment #6
qproOk , in my case it's solved:
"Allowed file extensions" (in "File upload Settings") is case sensitive.
I had added "xml" but our vendor files has "XML" extension, so the solution is to add XML (uppercase) to "Allowed file extensions" or rename all files extensions to xml (lowercase).
Thanks for your time reproduccing the issue, it makes me realize about the true problem.
Comment #7
MegaChriz CreditAttribution: MegaChriz at WebCoo commented@qpro
Ah, then your issue is probably different than the original issue here. The check for allowed file extensions when supplying a directory of files is new since 7.x-2.0-beta2 (added after this issue was created). See #2309471: File Fetcher doesn't obey allowed extensions.
I think that the extension check should be case insensitive, though.
Comment #8
ann b CreditAttribution: ann b commentedSame as #4. I'm getting the following errors after attempting to import a csv file:
*
Drupal 7.54
Feeds 7.x-2.0-beta3
*
But if I manually enter the path, then it worked ok.
private://feeds/test.csv
Comment #9
ericmulder1980 CreditAttribution: ericmulder1980 as a volunteer commentedI am getting this issue on Drupal 7.56 with Feeds 7.x-2.0-beta3. Strange thing is that it works without issues when manually running the import in a browser and even when running it through drush feeds-import-all. When running it through the Job Scheduler i get the "Resource is not a file or it is an empty directory" issue.
Comment #10
nikita_ttFor @ericmulder1980 (comment #9) and future researchers. I faced the same issue. The problem was in the way how cron was run.
In my case it was triggered via drush every minute. Command:
drush -l mysitealias -r /var/www/html cron
. Because of the "-l mysitealias" option the real path of the file was built wrong.