如何在 asp.net 中使用 Yahoo uploader 小部件上传文件

发布于 2024-12-07 01:58:51 字数 385 浏览 0 评论 0原文

许多人可能有使用 Yahoo 用户界面库 中的文件上传小部件的经验。文档和社区都知道如何使用 ASP.NET 之外的其他服务器技术接收服务器上的文件。如果有人确实在他们的 asp.net 页面中使用过该小部件,您可以分享

  1. 如何接收上传的文件流/字节到文件。

  2. 如何检查文件的完整性

  3. 如何检查文件是否正确接收。

另外,我很想在单页中执行此操作,因为这样做我将学习如何区分正常的网页请求和导致我的文件上传小部件的

雅虎上传小部件可以在这里找到:https://developer.yahoo .com/yui/uploader/

Many might have had experience using File Upload widget from Yahoo User Interface library. The docs and community all know how to receive the files on the server using another server technology other than ASP.NET. If anyone has indeed used the widget in their asp.net pages could you share the code on

  1. How to receive the uploaded files Stream/Bytes to a file.

  2. How to check Integrity of the File

  3. How to check if file was received correctly.

Also i would love to do it in single page because doing so i would learn how to differentiate between a normal webpage request and the one caused my file upload widget

Yahoo Upload Widget can be Found here: https://developer.yahoo.com/yui/uploader/.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

凉城 2024-12-14 01:58:51

您是否尝试过查看 postsfiles 集合?该 API 看起来像是一个标准的帖子。如果是,则只需使用该集合即可。

如果没有,那么您需要使用请求对象上的 inputstream 属性来读取传入的字节。

使用 Fiddler 或 firebug 等工具会告诉您它是如何发出请求的。查找请求类型为 multipart/mime

编辑
检查文件完整性&是否正确上传几乎是不可能的。我能想到的唯一方法是让用户生成文件的哈希值,然后上传文件并上传文件。哈希值&您检查哈希值是否有效。即不太实用。

您得到的只是字节流。你必须假设当流结束时,它干净地结束了并且结束了。你得到了所有的文件。

Have you tried looking at postedfiles collection though? The API looks like it does a standard post. If it does, the just use that collection.

If it doesn't, then you need to use the inputstream property on the request object to read the incoming bytes.

Using something like Fiddler or firebug will tell you how it's making the request. Look for the request type being multipart/mime

edit
Checking the file integrity & whether it was uploaded correctly are pretty much impossible. The only way I can think to do it is to have the user generate a hash of the file then upload the file & the hash & you check the hash is valid. ie not really practical.

All you're getting is a stream of bytes. you have to assume when the stream ends, it ended cleanly & you got all the file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文