Hi,

I'm Pre-uploading images and trying to import them directly from the library but keep getting the same error: "Failed to get the file object for FILENAME.jpg"

What is the path to the file am I meant to be putting the CSV? I've tried everything: public://filename.jpg, sites/default/files/filename.jpg, http://... etc etc etc.

Also tried all module releases.

Please help!!!

Comments

Niklas Fiekas’s picture

Hi. "From the library" means there is already an entry in the database. Have you tried using media_internet with public:// URLs instead?

StG’s picture

Issue summary: View changes

Hello,

I have been strugling with this issue for a while too. I installed Media Feeds in order to import videos from a youtube channel which works fine. Before that I could use (in an other importer) pre-uploaded images with public://path/filename.jpg syntax in CSV-iporter but now I get only error messages: If I map the image field as 'media_internet', I get the 'Unable to handle the provided embed string or URL' message. If I use 'by filename from library' mapper, I get the above-mentioned 'Failed to get the file object for FILENAME.jpg' message.

So it seems to me that Media Feeds makes impossible to import files from CSV which would be a terribel conclusion for me because I have to maintain a database of employees through CSV-import in a recent project. Any help would be really-really appreciated!

kreynen’s picture

Before you jump to conclusions conflicts between media_feeds and CSVs, can you manually create a node using the URL in the CSV? The 'Unable to handle the provided embed string or URL' error is coming from Media when it encounters a URL pattern that none of the media_[provider] modules enabled for the field can match. You can see where that gets called in the code here...

http://cgit.drupalcode.org/media_feeds/tree/media_feeds.module#n182

One option to use https://www.drupal.org/project/feeds_media_internet_files to populate the File Entities directly. I wrote this module after #1033202: [Meta] Generic entity processor finally got committed to Feeds (still only in the dev snapshot). Instead of the process Media Feeds uses to map fields to a Node and create a File Entity with the minimum fields, feeds_media_internet_files corrects problems with dealing with the media_[provider] URLs. All other fields are mapped directly to the entity.

In most use cases we use this with, an additional lookup is run on the entity_presave that maps an entity back to the node and populates the file field on the node. Like the YouTube Lookup module in https://www.drupal.org/project/cm_vod_feed. That module will parse the tags on YouTube video for matching nids, but this could just as easily be done using Media Feed's "From the library" option on a second import after creating the file entities with feeds_media_internet_files.