javascript - Get the file path from the dialog and trigger .change() when using duplicates -
this question has answer here:
i use small file upload dialog show images.
$("document").ready(function () { $("#dialogimageupload").change(function (input) { $(input.target.files).each(function (imageindex, currentimage) { if (currentimage.type.match('image.*')){ alert(currentimage.name); } }); }); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input type="file" id="dialogimageupload" multiple> <div id="imagelistcontainer"></div> so can read name of currentimage. how can full path it?
for example
var uploadedimage = $("<div><img src= thefilepath /></div>"); the second question have when using file dialog, change event gets triggered if different files selected before. if want upload file twice? change event not triggered anymore. can solve somehow?
you can not file path javascript, because of security limit browser.
you can change value '' js when click on
fileinput, triggeronchangeif choose anything.
Comments
Post a Comment