MCPcopy
hub / github.com/simstudioai/sim / inferAttachmentMimeType

Function inferAttachmentMimeType

apps/sim/providers/attachments.ts:179–187  ·  view source on GitHub ↗
(file: UserFile)

Source from the content-addressed store, hash-verified

177}
178
179export function inferAttachmentMimeType(file: UserFile): string {
180 const explicitType = file.type?.trim().toLowerCase()
181 if (explicitType && explicitType !== 'application/octet-stream') {
182 return explicitType
183 }
184
185 const inferred = getMimeTypeFromExtension(getFileExtension(file.name))
186 return inferred.toLowerCase()
187}
188
189function isTextDocumentMimeType(mimeType: string): boolean {
190 return (

Callers 5

downloadFileForUploadFunction · 0.90
uploadOpenAIFileFunction · 0.90
uploadGeminiFileFunction · 0.90

Calls 2

getMimeTypeFromExtensionFunction · 0.90
getFileExtensionFunction · 0.90

Tested by

no test coverage detected