
Company News
Andrew Becherer Joins Socket as Chief Information Security Officer
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.
@cuberqaq/transfer-file
Advanced tools
Polyfill of @zos/ble/transfer-file API for ZeppOS 2.0/2.1 device.
Corrently not support "progress" event or cancel sending task.
Some api were not tested. I don't know whether it could work correctly.
This repo is for ZeppOS device,not app-side. see CuberQAQ/zepp-fs-side: Polyfill of transferFile API for ZeppOS 1.0/2.0/2.1 app-side for app-side polyfill.
Use Command npm i @cuberqaq/transfer-file --save to install transfer-file in your ZeppOS Miniapp project.
In your app-side JavaScript source file, use this to import transfer-file:
import { TransferFile } from "@cuberqaq/transfer-file";
Then you can use the methods in the same way you do with @zos/ble/TransferFile. API Document see Zepp OS Developers Documentation
Receiving File:
import { TransferFile } from "@cuberqaq/transfer-file";
const transferFile = new TransferFile()
const inbox = transferFile.getInbox()
Page({
onInit() {
inbox.on('NEWFILE', function() {
const fileObject = inbox.getNextFile()
fileObject.on('change', (event) => {
if (event.data.readyState === 'transferred') {
console.log('transfered file success')
} else (event.data.readyState === 'error') {
console.log('error')
}
})
})
}
})
Send File:
import { TransferFile } from "@cuberqaq/transfer-file";
const transferFile = new TransferFile()
const outbox = transferFile.getOutbox()
Page({
onInit() {
const fileObject = outbox.enqueueFile("assets://logo.png", { test: 1})
fileObject.on('change', (event) => {
if (event.data.readyState === 'transferred') {
console.log('transfered file success')
} else (event.data.readyState === 'error') {
console.log('error')
}
})
}
})
By the way, it seems that the transfering speed could only reach 8kb/s :(
FAQs
Polyfill of @zos/ble/transfer-file API for ZeppOS 2.0/2.1
We found that @cuberqaq/transfer-file demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.