Where and how do I set the correct encoding when uploading files using xhr
问题 I am uploading image files, and I need them to work with accented characters - so I have made everything use UTF-8 . I use this javascript function to upload them: $('#files').change(function(e) { var formData = new FormData(); for (var i=0; i<this.files.length;i++){ formData.append(this.files[i].name, this.files[i]); } var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function(e) { if ( 4 == this.readyState ) { showMessage("Uploaded."); } }; xhr.open('post', 'accoms/upload.jsp', true)