Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get local file path in React Dropzone

Can anyone help me to let me know, how can I get to know the local file-path while uploading it through React-Dropzone in React.js?

like image 288
Yogendra Avatar asked Oct 17 '25 13:10

Yogendra


1 Answers

Getting the local file path of client is not permitted by browsers as it is a security risk. Some browsers only return the file name whereas some might return something like

C:/fakepath/filename

The browser will take care of the upload. Your web site doesn't need to know the full path of the file on client's machine. No one wants their local disk structure exposed on the web.

In short, it's not possible. It might help if you can explain why you want the full path?

like image 124
PiNaKa30 Avatar answered Oct 20 '25 03:10

PiNaKa30