h5bp / html5please

Graded Feature Support: Look up web technologies and find out if they are ready for use.
http://html5please.com/
MIT License
837 stars 265 forks source link

Addition for Multipart XHR #175

Open balupton opened 12 years ago

balupton commented 12 years ago

Spec defined here https://developer.mozilla.org/en/xmlhttprequest and here http://msdn.microsoft.com/en-us/library/ie/hh673569(v=vs.85).aspx

So far all I know is that it is implemented in the latest Chrome, Firefox and IE10 (not IE9 or earlier)

Use case is file uploads via XHR

paulirish commented 12 years ago

cool!

What should we say? Use? Warning?

what's the fallback story?

balupton commented 12 years ago

Tanks for that Paul, great questions.

According to jQuery File Upload (which would know best) the browser support is:

However IE10 should support as defined by microsoft's article here.

The fallbacks are:

  1. Use a 3rd party browser plugin. Requires that your user has the 3rd party plugin installed. Using flash supports cross domain with a crossdomain.xml. Flash polyfill is SWFupload. Many other 3rd party browser plugin polyfills are used in the library Plupload
  2. POST to an iframe. No browser requirements. Polyfill is jQuery Iframe Transport. For cross-domain uses it's a bit more complicated, as you don't have permission to read a cross-domain iframe (has no way to know if it completed or failed). To get past this, you have the options: 1. Use Pusher (or something similar) to notify the browser (cons of relying on a external service, con of delay). 2. Redirect the iframe back to the origin to either a special page or with a success or failure query string appended (con is that if you don't have access to the origin, the query string solution is not that nice).

The mentioned tools are probably best used with a proper library rather than just as utilities themselves (no point re-inventing the wheel). Libraries are jQuery File Upload (XHR or iframe), Plupload (supports every fallback known to man).

So it is a definite use with warning (and lots of them) feature.

Would you like me to submit it as a pull request and refine the above advice a bit more? If so, any suggestions on what the reformat should be like? If all these details are too much (or if we need more info) I'll be happy to post to my blog which could be used as reference.

Thanks :)

paulirish commented 12 years ago

Nice. Let's do a PR.

The content above is good but yeah it's starting to get too long for h5p. I'd say turn it into a blog post (and maybe with a demo?)

And then the content for the PR will be borwser support, big ass link to your blog post and the exec summary. (also why multipart XHR matters :)

arthurvr commented 9 years ago

@balupton Would you like to open a PR? :)

balupton commented 9 years ago

I finished my contract at the company where I was utilising that feature, besides the information above, my memory is gone.

Perhaps one of the polyfill authors may be an option.