Neo.ClientError.Statement.ExternalResourceFailed
Asked Answered
D

2

5
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?

Dissuasion answered 13/6, 2019 at 5:5 Comment(0)
R
6

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

Rees answered 13/6, 2019 at 5:19 Comment(1)
Did that still the file is not accessableDissuasion
B
0

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.

Bunkhouse answered 16/2, 2022 at 23:53 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Parliamentary

© 2022 - 2024 — McMap. All rights reserved.