Aravinth E Aravinth E - 2 years ago 237
Javascript Question

How to get selected file name and file path from input type file using jQuery

my code file name properly coming but file directory does not come.

my code

<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<title>jQuery Get Selected File Name</title>
<script type="text/javascript" src=""></script>
<script type="text/javascript">
var fileName =[0].dir;
alert('The file "' + fileName + '" has been selected.');
<input type="file">

how to solve this problem. please help me solve this.

czl czl
Answer Source

Returns the name of the file represented by a File object. For security reasons, the path is excluded from this property.

you can get the fileName but not path.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download