Skip to content
Devix Open Source

A big file, in pieces

Watch it go up chunk by chunk, then pull the plug halfway and send it again — it picks up where it left off.

Live preview
<div class="demo demo--wide">
  <input id="big" name="big" type="file">
  <div class="demo-row">
    <button class="demo-btn" id="send">Send a 12 MB file</button>
    <button class="demo-btn demo-btn--ghost" id="drop">Pull the plug</button>
    <button class="demo-btn demo-btn--ghost" id="again">Send it again</button>
  </div>
  <dl class="demo-kv" id="log"></dl>
  <p class="demo-hint">The "server" is a few lines running in this page: it writes each piece at the
    offset it was given and answers a <code>HEAD</code> with how much it holds.</p>
</div>