Clear file input on pste event, too

Fixes https://github.com/PrivateBin/PrivateBin/issues/318
This commit is contained in:
rugk 2018-05-22 13:09:15 +02:00
parent 567fa8b61f
commit 1985dff67c
No known key found for this signature in database
GPG key ID: 05D40A636AFAB34D
3 changed files with 6 additions and 3 deletions

View file

@ -2229,7 +2229,6 @@ jQuery.PrivateBin = (function($, sjcl, Base64, RawDeflate) {
loadedFile = $fileInput[0].files[0];
$dragAndDropFileName.text('');
} else {
// TODO: cannot set original $fileWrap here for security reasons…
$dragAndDropFileName.text(loadedFile.name);
}
@ -2375,6 +2374,10 @@ jQuery.PrivateBin = (function($, sjcl, Base64, RawDeflate) {
if (items.hasOwnProperty(i)) {
var item = items[i];
if (item.kind === 'file') {
//Clear the file input:
$fileInput.wrap('<form>').closest('form').get(0).reset();
$fileInput.unwrap();
readFileData(item.getAsFile());
}
}