Skip to content

Commit 3aa76be

Browse files
committed
Fix image upload path issue
Signed-off-by: Ryan Wang <i@ryanc.cc>
1 parent 7f83492 commit 3aa76be

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ui/src/views/tabs/MarkdownImport.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,9 @@ function findMatchingImageFile(imagePath: string): File | undefined {
156156
157157
async function uploadImageFile(imageFile: File): Promise<Attachment> {
158158
try {
159+
const imageBlob = await imageFile.arrayBuffer();
159160
const { data } = await ucApiClient.storage.attachment.createAttachmentForPost({
160-
file: imageFile,
161+
file: new File([imageBlob], imageFile.name, { type: imageFile.type }),
161162
waitForPermalink: true,
162163
});
163164

0 commit comments

Comments
 (0)