File copy from local to dbfs

Teja07
New Contributor II

How to copy a file from local disk to databricks dbfs path. I tried as below but it is throwing me error:

code i tried: dbutils.fs.cp("file://c:/user/file.txt",dbfs/data/) and dbutils.fs.cp("file:///c:/user/file.txt",dbfs/data/)

error: File not found excdeption

Ajay-Pandey
Databricks MVP

@Mani Teja G​ ,

Are u using databricks CLI??

Ajay Kumar Pandey

venkatcrc
New Contributor III

I assume you cannot copy files from Local machine to dbfs using dbutils. you can upload files to dbfs using below gui option .

Data --> Browse DFS --> Upload

image.png