我正在为移动和桌面浏览器开发一个应用程序。我想知道是否有办法检测浏览器是否支持文件上传。我正在寻找功能检测而不是浏览器检测。有什么办法可以查到吗?
服务器端或客户端都可以。
谢谢
最佳答案
客户端javascript:
<input type="file" name="file" value="" id="fileUploadField1">
<script type="text/javascript" charset="utf-8">
if (document.getElementById('fileUploadField1').disabled)
{ document.write('your device does not allow uploads'); }
else
{ document.write('your device does allow uploads'); }
</script>
关于mobile - 如何检测浏览器是否支持文件上传? (移动 + 桌面),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9304503/