Vaidehi Shejwalkar
Vaidehi Shejwalkar

Reputation: 75

Neo.ClientError.Statement.ExternalResourceFailed

load csv with headers from 'file:///C:/Users/user/Desktop/Neo4J'
as row 
Create (:State_Code {state_cd:row.st_cd})

I have tried this code and it is throwing an error as:

Neo.ClientError.Statement.ExternalResourceFailed: Couldn't load the external resource at: file:/C:/Users/ssarse/Desktop/Neo4J

Can anyone help me out with this?

Upvotes: 5

Views: 11983

Answers (2)

Suliman Haqqyar Jan
Suliman Haqqyar Jan

Reputation: 1

Make sure the file is clean and that you don't use the wrong extention; because in my experience not doing that can cause it to not be imported.

Upvotes: 0

Rajendra Kadam
Rajendra Kadam

Reputation: 4052

By default, Neo4j doesn't allow loading data from file URLs. And if allowed it reads files from the import directory only.

If you want to load files from other directories, you have to allow that in neo4j.conf

You can easily configure this:

  1. Find the neo4j.conf file for your Neo4j installation. Read here about file locations.

  2. Comment this line(By adding # in the start):

    dbms.directories.import=import
    
  3. Uncomment this line to allow CSV import from file URL:

    #dbms.security.allow_csv_import_from_file_urls=true
    
  4. Restart Neo4j

Upvotes: 7

Related Questions