html5 fileapi 二进制数据
如果没有 fileReader 类,您可以从文件中获取二进制数据吗?我正在尝试上传文件,并且它可以在 firefox & 中运行。 chrome/webkit 但 safari 5 没有文件阅读器。
必须有一种方法来获取二进制数据,因为 gmail 具有在 safari 5 中工作的拖放功能。
Can you get the binary data from a file without the fileReader class? I'm trying to upload files and I have it working in firefox & chrome/webkit but safari 5 doesn't have filereader.
There has to be a way to get the binary data as gmail has drag and drop that works in safari 5.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我解决了,感谢这里的演示: http://webreflection.blogspot.com/2009/03/safari-4-multiple-upload-with-progress.html
我只需要提供数据传输文件...
I worked it out, thanks to the demo here: http://webreflection.blogspot.com/2009/03/safari-4-multiple-upload-with-progress.html
I just need to feed the dataTransfer File...
我一直面临同样的问题,但我仍然不确定 xhr.send(file)。在使用 ASP.NET 时,我收到错误“检测到潜在危险数据......”。考虑到 FireReader 本身缺失,我认为 Safari 没有实现 xhr.send(file) 。
很高兴知道 xhr.send(file) 在 Safari 中可以工作。我会尝试进一步调查。
然而,有一个更好的替代方案,它可以很好地发挥 FormData 的作用。
我现在还面临一个问题,Chrome 中的 HTML5 DataTransfer 检测错误 如果您遇到过此问题并找到任何解决方案,请告诉我。
I have been facing the same problem but i am still not sure about the xhr.send(file). As while using the ASP.NET i got the error "Potentially dangerous data is detected ... ". I thought xhr.send(file) is not implemented by Safari considering FireReader itself is missing.
Its nice to know that xhr.send(file) works in the Safari. I will try investigate it further.
However there is a better alternative for this which works great FormData.
There is one more issue i am facing right now, its HTML5 DataTransfer detection error in Chrome please let me know in case you have faced and found any solution for this.