Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

微信内H5,ChooseImage,在Android编辑图片后,File的type丢失为空 #15018

Open
Luis-X opened this issue Dec 22, 2023 · 0 comments
Open
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x

Comments

@Luis-X
Copy link

Luis-X commented Dec 22, 2023

相关平台

H5

浏览器版本: Android微信内浏览器,版本8.0.44
使用框架: React

复现步骤

  1. 调用chooseImage,Android手机微信内打开,选择图片,左下角点击编辑,完成
  2. 此时tempFilePaths对应的图片,File对象返回的type为空
  3. 调用uploadFile,接口无响应,error 返回 fail undefined

期望结果

图片File对象正常返回,图片正常上传

实际结果

图片File对象type为空

环境信息

  Taro CLI 3.5.12 environment info:
    System:
      OS: macOS 14.0
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node
      npm: 8.11.0 - ~/.nvm/versions/node/v16.15.1/bin/npm
    npmPackages:
      @tarojs/cli: 3.5.12 => 3.5.12
      @tarojs/components: 3.5.12 => 3.5.12
      @tarojs/helper: 3.5.12 => 3.5.12
      @tarojs/plugin-framework-react: 3.5.12 => 3.5.12
      @tarojs/plugin-platform-alipay: 3.5.12 => 3.5.12
      @tarojs/plugin-platform-jd: 3.5.12 => 3.5.12
      @tarojs/plugin-platform-qq: 3.5.12 => 3.5.12
      @tarojs/plugin-platform-swan: 3.5.12 => 3.5.12
      @tarojs/plugin-platform-tt: 3.5.12 => 3.5.12
      @tarojs/plugin-platform-weapp: 3.5.12 => 3.5.12
      @tarojs/react: 3.5.12 => 3.5.12
      @tarojs/router: 3.5.12 => 3.5.12
      @tarojs/runtime: 3.5.12 => 3.5.12
      @tarojs/shared: 3.5.12 => 3.5.12
      @tarojs/taro: 3.5.12 => 3.5.12
      @tarojs/taro-h5: 3.5.12 => 3.5.12
      @tarojs/webpack5-runner: 3.5.12 => 3.5.12
      babel-preset-taro: 3.5.12 => 3.5.12
      eslint-config-taro: 3.5.12 => 3.5.12
      react: ^18.0.0 => 18.2.0

补充信息

代码同官方示例,也会出现

Taro.chooseImage({
  success (res) {
    const tempFilePaths = res.tempFilePaths
    Taro.uploadFile({
      url: 'https://example.weixin.qq.com/upload', //仅为示例,非真实的接口地址
      filePath: tempFilePaths[0],
      name: 'file',
      formData: {
        'user': 'test'
      },
      success (res){
        const data = res.data
        //do something
      }
    })
  }
})

WechatIMG670

@taro-bot2 taro-bot2 bot added F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x labels Dec 22, 2023
@github-project-automation github-project-automation bot moved this to Padding in H5 Dec 22, 2023
@ZakaryCode ZakaryCode moved this from Padding to API in H5 May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x
Projects
Status: API
Development

No branches or pull requests

1 participant