最近の検索


最近の検索はありません

How to create a new blob from attachment.contentUrl on ZAF

回答済み


投稿日時:2021年5月25日

Hi everyone,

I was trying to use comment.attachments() to get the attachment file from the comment, however it doesn't return the real File, it's just return the details of the attached file.

So I am thinking to create a new File by making a new blob file from attachment.contentUrl(), but I can't get it since I got CORS error when I am trying to get it using the fetch function.

This is my code:

this.ticketObj = await parentClient.get('ticket')
const attachmentObject = this.ticketObj.ticket.comment.attachments
const blobFile = await fetch(attachmentObject[0].contentUrl).then(r => r.blob())
const uploadFile = new File([blobFile], attachmentObject[0].filename, { type: attachmentObject[0].contentType })
 
I got the CORS error on the blobFile.
 
Any idea what I am missing?
 
Thank You.

0

1

1件のコメント

image avatar

Cheeny Aban

Zendesk Customer Care

Hi avdnowhere,

We suggest that you check How can I troubleshoot CORS? as a guide in troubleshooting CORS errors.

All the best!

 

0


投稿コメントは受け付けていません。

お探しのものが見つかりませんか?

新規投稿