1
votes

I am trying to load .csv file in Neo4j and getting below mentioned error:

Syntax : LOAD CSV WITH HEADERS FROM "file:///Users/Username/Downloads/products.csv"

Error : Couldn't load the external resource at: file:/C:/Neo4j/import/Users/Username/Downloads/products.csv

While I am able to load this file when it is placed in import directory. Please suggest how I can load this from local hard disk. While search, I found this options to debug this error-

"You can add the following setting in conf/neo4j.conf in order to bypass this :

dbms.security.allow_csv_import_from_file_urls=true"

--I couldn't find any config file/folder in this path.

1
What is the actual path of the file disk?Tim Biegeleisen
File Path : "C:\Users\username\Downloads\products.csv"Apy

1 Answers

0
votes

Based on this SO question, you need to specify an absolute path to a file when using LOAD CSV with a local file. However, it appears that you specified a relative path, and Neo4j seems to be interpreting it as belonging to the folder from which you (possibly) executed the command. In other words, you entered the relative path /Users/Username..., and Neo4j put this into its own folder.

From the documentation:

Make sure to use the right URLs esp. file URLs.+ On OSX and Unix use file:///path/to/data.csv, on Windows, please use file:c:/path/to/data.csv

Therefore, try the following:

LOAD CSV WITH HEADERS FROM "file:C:/Users/Username/Downloads/products.csv"