# Zoom Web SDK CORS error on sending file

**URL:** <https://devforum.zoom.us/t/zoom-web-sdk-cors-error-on-sending-file/105263>\
**Category:** Web\
**Created:** [March 7, 2024, 11:40pm UTC](https://devforum.zoom.us/t/zoom-web-sdk-cors-error-on-sending-file/105263 "2024-03-07T23:40:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevin6](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/kevin6/32/57313_2.png) [@kevin6](https://devforum.zoom.us/u/kevin6)\
**Post date:** [March 7, 2024, 11:40pm UTC](https://devforum.zoom.us/t/zoom-web-sdk-cors-error-on-sending-file/105263/1 "2024-03-07T23:40:20Z")

</div>

**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=](https://ngxdv.dv.zoom.us/wc/fileupload?filename=)\<file\_name\>&filesize=\<file\_size\>&rwg=\<some\_value\>&cid=\<some\_value\>’ from origin ‘[http://localhost:3000](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

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [March 8, 2024, 5:16am UTC](https://devforum.zoom.us/t/zoom-web-sdk-cors-error-on-sending-file/105263/2 "2024-03-08T05:16:38Z")

</div>

Hey @kevin6

Thanks for your feedback.

We are investigating the cause of the issue. I will inform you of any updates.

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [March 8, 2024, 5:58am UTC](https://devforum.zoom.us/t/zoom-web-sdk-cors-error-on-sending-file/105263/3 "2024-03-08T05:58:25Z")

</div>

Hey @kevin6

We connected to the same server and tested file sending, and it worked. The server can return the correct CORS headers.

Could you check if any network configurations are causing the issue? For example, using a proxy server that filters out these headers?

 ![test](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/f/4/f4665df130fdc5a065276a12ef22d8aa46681dbb.jpeg)

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![kevin6](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/kevin6/32/57313_2.png) [@kevin6](https://devforum.zoom.us/u/kevin6)\
**Post date:** [March 8, 2024, 6:12am UTC](https://devforum.zoom.us/t/zoom-web-sdk-cors-error-on-sending-file/105263/4 "2024-03-08T06:12:29Z")

</div>

Hi Vic. I tried again and now it is uploading successfully! Not sure what changed but it’s working now. Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [April 7, 2024, 4:12pm UTC](https://devforum.zoom.us/t/zoom-web-sdk-cors-error-on-sending-file/105263/5 "2024-04-07T16:12:34Z")

</div>

Closed on April 7, 2024, 4:12pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
