【问题标题】:React native version 63 image uploading issueReact Native 63版图片上传问题
【发布时间】:2021-04-04 10:02:12
【问题描述】:

缺少请求令牌: { URL: file:///var/mobile/Containers/Data/Application/0EFA47FC-4E6B-45B2-98CF-8F43676E6AB4/Documents/signature.png }

附上截图

【问题讨论】:

标签: ios react-native file-upload


【解决方案1】:

将“file://”替换为“/private”

dataForm.append('file', { uri: Platform.OS=='ios'?photo.uri.replace("file://", "/private"):photo.uri, name: 'photo .jpg',输入:'image/jpg' });

IOS : photo.uri.replace("file://", "/private")

它仅适用于真实设备,在模拟器上仍然会出现错误,但至少您可以部署您的应用,直到此问题得到修补

【讨论】:

    猜你喜欢
    • 2021-08-11
    • 2022-01-14
    • 2018-06-08
    • 2017-06-29
    • 2018-11-24
    • 1970-01-01
    • 2020-04-01
    • 1970-01-01
    • 2019-03-26
    相关资源
    最近更新 更多