【发布时间】:2023-03-11 10:32:01
【问题描述】:
问题
为了上传文件,我构建了一个 HTML 网络表单。 When accessed from an iOS device, non-image files (.pdf, .docx, etc.) appear greyed-out when the "Browse" button is chosen to select a file from the iOS file explorer.
我有一个功能齐全的页面(HTML、CSS、JS、PHP),但我已将整个页面剥离为最简单的表单元素来测试功能。以下是在运行 iOS 12.3 的设备上查看时不在我的服务器上运行的代码示例(这是 HTML 文件中除样板标签之外的全部内容):
<form action="" enctype="multipart/form-data" method="post">
<input type="file" accept="image/*, .heic, .hevc, .heif, .pdf, .png, .gif, .jpg, .jpeg, .doc, .docx, image/png, image/jpg, image/jpeg, image/gif, application/msword, application/pdf" multiple>
</form>
您可以看到一个类似的简单工作示例,该示例可以使用 W3School 的“Try It”编辑器之一从 iOS 设备中选择非图像文件:
https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_input_type_file
我的尝试
- SSL(扩展验证)
- Apple 技术支持(在电话上几个小时后转到 Apple Developer 网站)
- 多种浏览器(iOS Safari、iOS Chrome、iOS Google App)
- 多个 Apple 设备(在 Mac 上工作,在 iPhone 和 iPad 上失败)
- 竞争平台(适用于 Android)
- iOS 13 测试版(有效)
问题
某些原因导致 W3School 和其他网站的服务器在 iOS 上使用表单时的行为与我的不同。
iOS 上决定哪些网站/表单能够选择非图像文件进行上传的因素是什么?
【问题讨论】:
标签: html ios forms mobile file-upload