W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
讀取本地文件內(nèi)容
繼承標(biāo)準(zhǔn)對(duì)象輸入,擴(kuò)展屬性描述:
屬性 | 類型 | 默認(rèn)值 | 是否必填 | 說明 |
---|---|---|---|---|
filePath | string | 是 | 要讀取的文件的路徑 | |
encoding | string | 否 | 指定讀取文件的字符編碼,如果不傳 encoding,則以 ArrayBuffer 格式讀取文件的二進(jìn)制內(nèi)容 |
值 | 說明 |
---|---|
ascii | |
base64 | |
binary | |
hex | |
ucs2/ucs-2/utf16le/utf-16le | 以小端序讀取 |
utf-8/utf8 | |
latin1 |
屬性 | 類型 | 說明 |
---|---|---|
data | string/ArrayBuffer | 文件內(nèi)容 |
屬性 | 類型 | 說明 | 支持版本 |
---|---|---|---|
errMsg | string | 錯(cuò)誤信息 |
值 | 說明 |
---|---|
fail no such file or directory, open ${filePath} | 指定的 filePath 所在目錄不存在 |
fail permission denied, open ${dirPath} | 指定的 filePath 路徑?jīng)]有讀權(quán)限 |
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: