MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / uploadFile

Method uploadFile

packages/server-e2e/src/http.ts:333–346  ·  view source on GitHub ↗
(input: {
    name: string;
    data: UploadFileData;
    mediaType?: string;
    expiresInSec?: number;
  })

Source from the content-addressed store, hash-verified

331
332 // ── Uploads ─────────────────────────────────────────────────────────────
333 uploadFile(input: {
334 name: string;
335 data: UploadFileData;
336 mediaType?: string;
337 expiresInSec?: number;
338 }): Promise<FileMeta> {
339 const form = new FormData();
340 form.append('name', input.name);
341 if (input.expiresInSec !== undefined) {
342 form.append('expires_in_sec', String(input.expiresInSec));
343 }
344 form.append('file', blobFromInput(input), input.name);
345 return this.formRequest<FileMeta>('POST', '/files', form);
346 }
347 deleteFile(fileId: string): Promise<{ deleted: true }> {
348 return this.request('DELETE', `/files/${encodeURIComponent(fileId)}`, undefined);
349 }

Callers

nothing calls this directly

Calls 3

formRequestMethod · 0.95
blobFromInputFunction · 0.85
appendMethod · 0.65

Tested by

no test coverage detected