In order to overcome the "The selected file could not be used because the file does not exist in the database" issue when using filefield_sources with imce_filefield as described in many places -

http://drupal.org/node/436182
http://drupal.org/node/1960016
http://www.freelock.com/blog/john-locke/2010-02/using-file-field-importe...

I created a drush command based on the one provided in the last link. It will scan the private, public or any custom path for any unmanaged files (files that do not have a corresponding entry in the file_managed table) and will optionally import those files.

Just place findfiles.drush.inc in ~/.drush, issue a "drush cc drush" to clear the drush command cache and you're good to go. See "drush help filescan" for help on the command and its options.

Hope it helps someone, and please do backup your database!

CommentFileSizeAuthor
findfiles.drush_.inc_.txt6.33 KBbohemier
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

moshe weitzman’s picture

Status: Needs review » Closed (won't fix)

Thats useful but not generally applicable enough for drush core. Try another project or start your own. Thanks.

bohemier’s picture

OK, Thanks Moshe