MCPcopy Create free account
hub / github.com/RioArisk/claudecode_api_RemoteControl / fileChunkToBase64

Function fileChunkToBase64

app/src/modules/image-upload.js:117–128  ·  view source on GitHub ↗
(blob)

Source from the content-addressed store, hash-verified

115}
116
117function fileChunkToBase64(blob) {
118 return new Promise((resolve, reject) => {
119 const reader = new FileReader();
120 reader.onerror = () => reject(reader.error || new Error('Failed to read image chunk'));
121 reader.onload = () => {
122 const result = String(reader.result || '');
123 const commaIdx = result.indexOf(',');
124 resolve(commaIdx >= 0 ? result.slice(commaIdx + 1) : result);
125 };
126 reader.readAsDataURL(blob);
127 });
128}
129
130function fileToDataUrl(file) {
131 return new Promise((resolve, reject) => {

Callers 1

startImageUploadFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected