MCPcopy Create free account
hub / github.com/AnswerOverflow/AnswerOverflow / uploadFile

Function uploadFile

packages/core/src/files.ts:40–57  ·  view source on GitHub ↗
(file: {
	filename: string;
	contentType: string;
	stream: PutObjectCommandInput['Body'];
})

Source from the content-addressed store, hash-verified

38}
39
40export async function uploadFile(file: {
41 filename: string;
42 contentType: string;
43 stream: PutObjectCommandInput['Body'];
44}) {
45 if (sharedEnvs.NODE_ENV === 'test') return null;
46 return new Upload({
47 client: s3bucket,
48
49 params: {
50 Bucket: sharedEnvs.BUCKET_NAME as string,
51 Key: `${file.filename}`,
52 Body: file.stream,
53 ContentDisposition: 'inline',
54 ContentType: file.contentType,
55 },
56 }).done();
57}

Callers 1

generateSitemapFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected