第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

上傳圖片轉(zhuǎn)base64,報(bào)錯(cuò)

上傳圖片轉(zhuǎn)base64,報(bào)錯(cuò)

慕哥9229398 2019-03-14 15:11:46
報(bào)錯(cuò):ERROR TypeError: Failed to execute 'readAsDataURL' on 'FileReader': parameter 1 is not of type 'Blob'.這是用ionic寫(xiě)的\\xx.html<input type="file" (change)="selectImage(this.files)" accept="image/jpeg,image/png,image/jpg">\\xx.tsselectImage(file){      var reader = new FileReader();      reader.onload = function(file){        // console.log(evt.currentTarget)      }      reader.readAsDataURL(file);      console.log(reader.readAsDataURL(file));    }
查看完整描述

3 回答

?
米脂

TA貢獻(xiàn)1836條經(jīng)驗(yàn) 獲得超3個(gè)贊

selectImage(event){

      let reader = new FileReader();

      let file = event.target.files[0];

      reader.readAsDataURL(file);

      reader.onload = function(){

        console.log(reader.result)

      }

    }


查看完整回答
反對(duì) 回復(fù) 2019-04-02
?
MM們

TA貢獻(xiàn)1886條經(jīng)驗(yàn) 獲得超2個(gè)贊

this.files是個(gè)類(lèi)數(shù)組吧,取第一個(gè)reader.readAsDataURL(file[0]);


查看完整回答
反對(duì) 回復(fù) 2019-04-02
?
繁星淼淼

TA貢獻(xiàn)1775條經(jīng)驗(yàn) 獲得超11個(gè)贊

我想問(wèn)下我怎么把blob轉(zhuǎn)成base64呀。我獲取的字符串為:url("blob:http://localhost:8080/cc116c31-f8f1-47b1-a87b-96d948253495")。請(qǐng)大神賜教


查看完整回答
反對(duì) 回復(fù) 2019-04-02
  • 3 回答
  • 0 關(guān)注
  • 2734 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)