Convert file paths to file:// URLs for server compatibility

This commit is contained in:
Shantur Rathore
2025-10-24 00:55:20 +01:00
parent f291649f74
commit 79fe1c4b7b
2 changed files with 12 additions and 3 deletions

View File

@@ -166,7 +166,7 @@ export default function PromptInput(props: PromptInputProps) {
const alreadyAttached = existingAttachments.some((att) => att.source.type === "file" && att.source.path === path)
if (!alreadyAttached) {
const attachment = createFileAttachment(path, filename)
const attachment = createFileAttachment(path, filename, "text/plain", undefined, props.instanceFolder)
addAttachment(props.instanceId, props.sessionId, attachment)
}
@@ -237,7 +237,7 @@ export default function PromptInput(props: PromptInputProps) {
const filename = file.name
const mime = file.type || "text/plain"
const attachment = createFileAttachment(path, filename, mime)
const attachment = createFileAttachment(path, filename, mime, undefined, props.instanceFolder)
addAttachment(props.instanceId, props.sessionId, attachment)
}