Hi,
I am kinda new to feeds and working on setting up a feed importer to import data from csv files to nodes.
The import works fine when done manually from a standalone form in browser.

But I would like to do this import automatically to run a few times a day from csv files that are dropped into a folder on the server periodically.

In the settings page admin/structure/feeds//settings
For 'Attached to content type' I selected the content type of the feed instead of 'Use standalone form'.
Periodic import is set to "Every 15 mins". Unchecked import on submission and process in background.

In Fetcher - File upload settings, i checked 'Supply path to file or directory directly'
and Allowed schemes - checked private: Private local files served by Drupal.
I dropped some cvs files into the files_private subdirectory from where drupal serves the local files.

I manually ran cron a few times, but no files get uploaded into the feeds content node.

What am i doing wrong? any help would be much appreciated.

thanks.

Comments

Stefan Lehmann’s picture

I just checked the settings in an installation where this stuff is working.

Allowed file extensions:
txt csv tsv xml opml

The set upload directory is:
private://feeds

.. and an actual file on the server would be:
/sites/{site}/private/files/feeds/example.csv

Is your configuration similiar to that? Did you check the error logs?

I like cookies!

gokul0801’s picture

Thanks.

Setup is similar to that.
Allowed file extensions : csv
set upload directory is set to private://feeds.

The import works fine if i upload it manually from a file in my local file system.
However when i force the import with cron to do a bulk upload, i get the error

Resource is not a file or it is an empty directory: private://feeds/price.csv

private://feeds directory has all the csv files that need to be uploaded.

Strange that it looks for the name of the last file uploaded (in this case price.csv was the file that i uploaded manually). The set of file names in the private://feeds folder are named something like price_.csv
price_20150709.csv, price_20150708.csv.

Stefan Lehmann’s picture

I'd assume, that it will always only grab the file with the newest timestamp, as it probably assumes, that the CSVs in this folder all target the same content on your website and it wouldn't make sense to import a file with older content.

So I guess it means you can't have multiple CSVs being imported from a folder. The newest CSV has to have all the data, to be imported at any point in time - which makes some kind of sense to me.

I like cookies!

gokul0801’s picture

Yup. i moved content from all the older price files into one large csv file to get this working and did an upload with cron to make it work.
thanks for your help.