# Browser file transfers (Browser Preview 17)

The signed-in browser can upload files and browse/download files from the Host's
configured download root. Install the complete **Browser Preview 17** Host package
(`1.0.268+browser.17`) and reload the browser page. The native Maximizer Client is
unchanged. Preview 16 does not contain this feature and remains a rollback option.

## Access and setup

- Existing Host **Network** settings independently control uploads and downloads:
  `file_transfer_enable`/`file_transfer_dir` and
  `file_download_enable`/`file_download_dir`. Both directions remain disabled by
  default. An administrator must enable the intended direction and restart the
  Host normally. Browser sign-in does not enable or change any setting.
- Open **File transfers** below setup/the player, or **More → File transfers**
  while streaming. The latter releases input capture and leaves fullscreen so
  local controls do not type into the remote application. Streaming may continue.
- Uploading uses an explicit file selection followed by **Upload selected files**.
  Existing Host files are kept; collisions receive a new filename. This initial
  browser version handles single or multiple files, not recursive folder uploads
  or replacement/skip policies. The native Client retains those features.
- **Open Host download folder** lists only the administrator-selected root.
  Subfolders can be browsed; select individual files to download. Symlinks,
  traversal and private transfer state remain excluded by the native storage engine.

## Verification and browser save behavior

Upload hashing runs incrementally in a dedicated Worker, using bounded memory.
One file is transferred at a time in chunks of at most 1 MiB. The Host verifies
complete content, flushes/closes and publishes through the same protected native
transfer journal. Success requires a matching session, size, SHA-256 and published
filename receipt—not an HTTP 200 alone.

Downloads use the native owner-bound immutable snapshot, at most 256 KiB per
request, with per-chunk and complete-file SHA-256 checks in the Worker. Where
`showSaveFilePicker` is available, an explicit picker grants the chosen output;
checked temporary writes are committed only after the complete checksum matches.
Cancel/failed checksum aborts the temporary write, not an existing user file.

Without that picker, downloads are limited to **64 MiB**, one retained in-memory
file at a time. Once verified, **Save file** hands a Blob to the browser's download
manager. The page cannot acknowledge the final OS save: check browser Downloads.
Use a supported save-picker browser or native Client for larger downloads.

## Pause, retry and lifetime

- Transfer records and selected File/handle references are **in memory for this
  tab only**, maximum 32 records. No tokens, filenames, file data or handles are
  stored in localStorage/IndexedDB. Clear finished records frees retained Blobs.
- Pause aborts network/hash work. Resume rechecks the *same* owner/request key and
  Host offset/receipt; it does not silently create another upload. A local download
  restarts its temporary save/hash from zero using the same immutable snapshot.
- Cancel reconciles the same request. Already published files are reported as
  published and are never deleted. A lost response remains unconfirmed until an
  explicit Resume/Cancel resolves it. Forget record is an explicitly confirmed
  local action, not a remote cancellation or file deletion.
- Closing/reloading or signing out forgets tab records; in-flight work may have
  reached the Host already. Unfinished Host data/receipts expire after seven idle
  days through existing native retention. Published user files are not expired.
- Stream disconnect is separate from login/transfers. Existing 15-minute browser
  login expiry and account deletion/password-change checks remain enforced for
  every transfer request. Sign in again after expiry; no automatic login renewal.

## Security and native compatibility

`POST /files` is a narrow same-origin route with the in-memory login token in
`X-Maximizer-Session`, never a query parameter or cookie. A dedicated two-request
gateway admission pool prevents transfer pressure from occupying control slots.
The Host derives a namespaced account owner from verified account identity and
password revision. Native paired-certificate owners cannot collide with it.
Neither browser nor gateway can select an owner or arbitrary native API URL.

The native HTTPS transfer server admits browser work onto **its existing two-slot
disk pool and exact upload/download store instances**. There is no second journal,
new pairing, file-service process, direct browser access to GameStream routes,
CORS relaxation or changes to native Client/storage protocols. Browser metadata
and chunks/replies are bounded; native root, revision, quota and free-space checks
remain authoritative. No background filesystem scanning is added.

Implementation tests are recorded separately in
`Documents/.browser-file-transfer-20261030/`; the authorized Preview 17 publication,
exact published-package acceptance and installation have separate receipts in
`Documents/.browser-preview17-20261030/`. Build success alone is not package-runtime
or native save-dialog/platform acceptance. Existing transfer opt-ins and roots
must be retained during an upgrade; installing this package does not enable them.

Local acceptance passed actual Chrome uploads/downloads and independent saved-byte
checks, upload/download pause/reconciliation/cancel, keep-both, multiple files,
Unicode and empty files, chunk/whole-file corruption rollback, rooted account
isolation, logout/password-revision revocation and concurrent private software-H.264
video through three connections. The tested browser file-size boundary was 8 MiB;
the 64 MiB fallback ceiling is a separate enforced browser-memory policy, not a
claim that larger browser-file/platform combinations were qualified. Picker tests
use real OPFS transactions through a controlled grant, not native permission dialogs.
