In Bootstrap FileStyle (http://markusslima.github.io/bootstrap-filestyle/) how can I use make it get the full path instead of only the file name ?
Asked
Active
Viewed 5,627 times
1 Answers
3
I see that the Bootstrap FileStyle plugin start from a standard input file element.
So you can get its value by:
$("input[type=file]").val();
Demo code:
$(document).ready(function () {
$(":file").filestyle({
classButton: "btn btn-primary"
});
$("#getFileName").click(function () {
alert($("input[type=file]").val());
});
});
Demo: http://jsfiddle.net/IrvinDominin/8CpnH/
EDIT
If you want to get the full path name you'll face a "problem" not related to the plugin, but to browser security reasons.
You can check some related and deep questions on SO like How to get full path of selected file on change of <input type=‘file’> using javascript, jquery-ajax?

Community
- 1
- 1

Irvin Dominin
- 30,819
- 9
- 77
- 111