javascript - Get the file path from the dialog and trigger .change() when using duplicates -


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?

  1. you can not file path javascript, because of security limit browser.

  2. you can change value '' js when click on file input, trigger onchange if choose anything.


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -