A large file on a slow or unsteady network, a phone moving between cells for example, no longer starts again from its first byte. A ResumableUploadField sends each file in chunks to a resource the application mounts, ResumableUploadResourceReference, the one proposed for Wicket 12, over tus, the open protocol of resumable uploads: the browser creates the upload, sends the chunks, and after a pause, a broken connection or a reload asks the server how many bytes it holds and sends the rest only.
Each file has its row: its progress bar, what was sent, how fast and how long it still takes, and its buttons pausing, resuming and canceling it. Two files are sent at once here; the others wait for their turn. A broken connection is tried again by itself, the server asked first where it stopped; offline, the upload waits until the network is back. Once the connection stays lost for longer, a VPN that went down for example, the files wait for the server to answer again, and then the field asks whether to resume them or cancel them. Tick the box below the zone and the server breaks off a chunk now and then: watch the rows go on.
Reload the page while a file is being sent: the field lists the uploads that did not end, how far each got, and asks whether to go on with them; Continue opens the dialog, and the same file chosen again goes on from there. The browser keeps the address of each upload not finished in its localStorage; the server keeps the bytes for 30 minutes after the last chunk, for the session that sent them only. An application whose users sign in can keep them for the user instead, beyond the session, and the user goes on after signing in again.
Once the server holds a whole file, onUploadSuccess() of the field gets it: the demo reads its SHA-256, to compare with that of the file sent, and deletes it. The React and Svelte apps use the same uploader of the core, and hand each file over to a resource of the demo that does the same. Being tus, they work with any tus server, tusd or tus-java-server among them, and any tus client works with the Wicket resource.
The settings below the zone slow the server down for this session, to watch the chunks on a fast network. A file larger than a proxy lets a request carry goes through all the same, in chunks smaller than that.
The server keeps track of the uploads, with an IUploadsTracker, by their owner and their context, the part of the application they belong to: the list below shows the unfinished ones of this session in the context of the demo, and the field offers to go on with them from any page of the same context. An application whose users sign in finds them again in the next session; this demo keeps nothing of its visitors beyond the session.