Locally, the uploaded pictures will be converted to Base64 code and saved to an array, and the same files cannot be added continuously.

locally, the uploaded image is converted to Base64 code and saved to an array, and the same file cannot be added continuously. At this time, if you add another picture, you will have no problem if you add it back to the previous one.

    <input  type="file" name="file" class="jokeFile" value="" id="addUppLoadFile" onChange="addUploadInvoice()" accept="image/*">
     

window.addUploadInvoice = ()=>{
    let ffval = $("-sharpaddUppLoadFile").val();
    if(!/.(jpg|jpeg|png|bmp)$/.test(ffval)){
        commonModule.showAlertTips("jpgjpegbmppng")
        return false;
    }

    let addfile = document.getElementById("addUppLoadFile").files[0];
    let rWind = new FileReader();  //
    rWind.onload = function(){
        addModalVm.localImgList.push(rWind.result);
        console.log(addModalVm.localImgList.length)
    }
    rWind.readAsDataURL(addfile);
}
Mar.09,2021
Value was emptied when

onChange= "addUploadInvoice ()" . Then you can choose the same file. No. Otherwise, the same file will not trigger change


instead of onClick

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4338f-4cdb6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4338f-4cdb6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?