Description
On calling chatClient.sendFile(file, userId), I receieve a 403 CORS error. I am making the request from localhost. File upload is enabled in my account settings and chatClient.isFileTransferEnabled() returns true.
Am I missing something obvious? I assume this should be callable from the frontend… right? Video, Audio and chat messages working fine.
Browser Console Error
Access to XMLHttpRequest at ‘https://ngxdv.dv.zoom.us/wc/fileupload?filename=<file_name>&filesize=<file_size>&rwg=<some_value>&cid=<some_value>’ from origin ‘http://localhost:3000’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource
Which Web Video SDK version?
1.10.8
Video SDK Code Snippets
async sendChatFile(file: File, userId: number): Promise {
if (file) {
if(this.chatClient.isFileTransferEnabled()) {
await this.chatClient.sendFile(file, userId)
} else {
console.error(‘File transfer is not enabled’)
}
}
}
client.on('chat-file-upload-progress', (payload) => {
const { status, progress, fileName } = payload
if (status === 1) {
//nothing
} else if (status === 3) {
console.log(‘upload failed’)
} else if (status === 4) {
console.log(File ${fileName} upload canceled
)
} else if (status === 5) {
console.log(File ${fileName} upload successful.
)
}
})
To Reproduce(If applicable)
Steps to reproduce the behavior:
Call sendFile with a file and different userId
Device (please complete the following information):
MacOS Arm64
Google Chrome: 122.0.6261.94