Skip to content

Commit

Permalink
feat: add warning if non UTF-8 characters in filename
Browse files Browse the repository at this point in the history
  • Loading branch information
leonidastri committed Aug 26, 2024
1 parent 8def5c3 commit b252326
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion research/static/research/js/research.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,19 @@ $(function () {
browse(path)
})
r.on('fileSuccess', function (file, message) {
$('#' + file.uniqueIdentifier + ' .msg').html("<span class='text-success'>Upload complete</span>")
try {
decodeURIComponent(escape(file.name));
} catch (e) {
$('#' + file.uniqueIdentifier).prepend(`
<div class="container">
<div class="alert alert-primary">
Uploaded file will be renamed because not all non UTF-8 characters are supported.
</div>
</div>
`);
}

$('#' + file.uniqueIdentifier + ' .msg').html("<span class='text-success'>Upload complete</span>");
const $self = $('#' + file.uniqueIdentifier)
$self.find('.upload-btns').hide()
const path = $('.upload').attr('data-path')
Expand Down

0 comments on commit b252326

Please sign in to comment.