MCPcopy Create free account
hub / github.com/callstackincubator/react-native-fast-io / sendFile

Function sendFile

example/tests/filesystem.tsx:19–29  ·  view source on GitHub ↗
(compression?: 'gzip' | 'deflate' | 'deflate-raw')

Source from the content-addressed store, hash-verified

17 }
18
19 const sendFile = async (compression?: 'gzip' | 'deflate' | 'deflate-raw') => {
20 if (!file) {
21 return
22 }
23 const body = compression ? file.stream().pipeThrough(new CompressionStream(compression)) : file
24
25 await fetch(`http://${BASE_URL}:3002/upload`, {
26 method: 'POST',
27 body,
28 })
29 }
30
31 const logContents = async () => {
32 for await (const chunk of file!.stream()) {

Callers 1

FileSystemUIFunction · 0.85

Calls 2

fetchFunction · 0.90
streamMethod · 0.45

Tested by

no test coverage detected