TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Building an HTML5 Drag & Drop File Uploader Using Sinatra and jQuery: Part 1

77 pointsby texelover 14 years ago

2 comments

swombatover 14 years ago
I'm not sure why he dismisses the FileAPI right away... one of the goals of the Reader according to <a href="http://www.w3.org/TR/FileAPI/" rel="nofollow">http://www.w3.org/TR/FileAPI/</a> is:<p><i>User agents should provide a streamlined programmatic ability to send data from a file to a remote server that works more efficiently than form-based uploads today</i><p><i>Example: A Video/Photo Upload App. User is able to select large files for upload, which can then be "chunk-transfered" to the server.</i><p>This means that although this XMLHttpRequest2 method is nice, in practice it will still suffer from all the issues that http uploads suffer from at the moment. Chunked uploading, which the W3C spec explicitly supports, would be a much better solution for large files, no?
评论 #1844169 未加载
评论 #1844208 未加载
steveklabnikover 14 years ago
Note the suspicious lack of commentary on which version of IE supports XMLHttpRequest level 2. Is it supported? And is there an elegant way to fallback to the old iframe approach? Conditionally including Javascript files seems to be a poor choice, I'm not sure if I'd rather just stick with the old way, even if it's awkward.<p>--------<p>An aside: I found the "XMLHttpRequest Level 2" name to be pretty funny. I'm not sure why it tickled my funny bone in such a way.<p><pre><code> A wild XMLHttpRequest (lvl 1) appears! Engineer uses SendFile... it doesn't seem to be working. Engineer is defeated! A wild XMLHttpRequest (lvl 2) appears. Engineer uses SendFile... it's super effective!</code></pre>
评论 #1844185 未加载