I am using input tag with attribute type="file" in HTML.
If I browse and select image and try to get path of file with $('file_upload').val() in script it returns path as "C:\fakepath\img_name"*
I need to get this path and set as default to input tag from JavaScript.
Please help me with this.
Script:
$(document).ready(function() {$('#imgUpload_edit').change(
function(){if ($(this).val()) {alert($('#imgUpload_edit').val());} }); });
HTML:
<FORM id="frmImgUpload_edit" ENCTYPE="multipart/form-data" ACTION="" METHOD="POST">
<label for="imgUpload_edit" id="bold-text_edit">Select an image for the Device Type:</label>
<input type="file" id="imgUpload_edit" name="deviceTypeImage_edit" size="10000"/>
<div id="imageEditDeviceType"></div>
</FORM>