@db-state/vue-files

Vue client file upload/download module for db-state over the same WebSocket.
2,300 1
Install
npm install @db-state/vue-files
Latest Version:0.3.11
Vue:3
License:MIT
Last Updated:Oct 13, 2026
Links: GitHub  ·  npm
Maintainer: ivan24ivan

@db-state/vue-files

Vue-клиент для upload/download файлов поверх @db-state/vue.

Он использует существующий db-state WebSocket и автоматически регистрирует state.file, если таблица еще не подключена.

import { createFileClient } from "@db-state/vue-files"

const files = createFileClient(state)

const uploaded = await files.upload(file, {
  policy: { mode: "registered" },
  onProgress: ({ loaded, total, percent }) => {}
})

await state.message.add({
  text,
  file: [uploaded.token]
}, "message-form")

const blob = await files.download(uploaded.token, {
  onProgress: ({ loaded, total, percent }) => {}
})

files.url(uploaded.token) // /f/<token>

upload сначала считает SHA-256 файла; если такой файл на сервере уже есть, байты не отправляются, а в результате deduplicated: true. { hash: false } отключает хэш; файлы больше hashMaxSize (256 МБ) грузятся без хэша.

Progress передачи файлов идет через onProgress. Он специально отделен от state.getKeyRef(key), который остается loading/helper-объектом для обычных db-state чтений и записей.

Полная документация: docs/ru/files.md.

Related Packages

@browsercapturesalt/config

Edit your env var config, encrypt and upload it to a git repo. Get your config d...

713
@enso-ui/files

File browser and file type administration pages for Enso UI

14,675 0
@db-state/vue

Tiny reactive Vue 3 client for db-state: typed tables, listRef / idsRef / countR...

3,795 1
file-uploader-vue-component

A vuejs component of file uploader.

3,739 12
vue-simple-file-upload

a simple vue file upload component

956 5

Version History

Version Released Vue License
0.3.11 >=3.0.0 MIT
0.3.10 >=3.0.0 MIT
0.3.8 >=3.0.0 MIT
0.3.3 >=3.0.0 MIT
0.3.2 >=3.0.0 MIT