You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Telegram Web App安卓端多文件选择失效问题求助

安卓Telegram Web App多文件上传失败的原因及解决建议

问题原因

  • 安卓Telegram内置WebView的文件处理限制:安卓版Telegram使用的定制化WebView(基于Chrome内核)在处理多文件选择时,存在文件路径解析或权限授权的bug。选择多文件时,WebView无法正确获取部分文件的本地访问权限,导致系统返回"file not found"错误;而单选文件时,权限能正常授予,因此可以正常工作。
  • 跨平台WebView实现差异:iOS端Telegram使用WKWebView,对HTML5的<input type="file" multiple>支持更完善,而安卓端的定制WebView在多文件处理逻辑上存在兼容性缺陷。

临时解决方法

  1. 拆分多文件为多个单文件输入:暂时移除multiple属性,添加多个独立的<input type="file">,让用户逐个选择文件,这种方式能规避安卓Telegram的多文件bug。
  2. 读取文件内容转为Base64提交:在文件选择后,使用FileReader将文件内容转为Base64编码,再通过接口提交,避免依赖本地文件路径。示例代码如下:
const handleFileChange = (e) => {
  const files = Array.from(e.target.files);
  files.forEach(file => {
    const reader = new FileReader();
    reader.onload = (event) => {
      const base64Data = event.target.result;
      // 存储base64数据,后续提交到服务器
    };
    reader.readAsDataURL(file);
  });
};
  1. 更新Telegram到最新版本:部分旧版本的安卓Telegram存在WebView的已知bug,更新到最新版可能修复该问题。

内容的提问来源于stack exchange,提问作者Kalinina Oksana

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.27 16:51:00