小编Tam*_*ago的帖子

如何在react-native-document-picker中将PDF转换为base64?

我想将react-native-document-picker 的响应转换为base64 格式。作为响应,我得到了文件的 Uri,但不幸的是没有 base64。

这是我的代码:

const openDocumentFile = async () =>{
        try {
            const results = await DocumentPicker.pickMultiple({
              type: [DocumentPicker.types.pdf],
              readContent: true
            });
            for (const res of [results]) {
           
              console.log(res)
          
            };
                
          } catch (err) {
            if (DocumentPicker.isCancel(err)) {
            } else {
              throw err;
            }
          }
    } ```


Run Code Online (Sandbox Code Playgroud)

javascript base64 reactjs react-native

7
推荐指数
1
解决办法
8472
查看次数

标签 统计

base64 ×1

javascript ×1

react-native ×1

reactjs ×1