# Issues regarding file.zoom.us

**URL:** <https://devforum.zoom.us/t/issues-regarding-file-zoom-us/91878>\
**Category:** Chat\
**Tags:** api\
**Created:** [July 16, 2023, 7:59am UTC](https://devforum.zoom.us/t/issues-regarding-file-zoom-us/91878 "2023-07-16T07:59:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ns19](https://avatars.discourse-cdn.com/v4/letter/n/eada6e/32.png) [@Ns19](https://devforum.zoom.us/u/Ns19)\
**Post date:** [July 16, 2023, 7:59am UTC](https://devforum.zoom.us/t/issues-regarding-file-zoom-us/91878/1 "2023-07-16T07:59:12Z")

</div>

## Is the `file` subdomain working correctly?

I am not able to upload any file using the steps mentioned in the [docs](https://developers.zoom.us/docs/api/rest/reference/chat/methods/#operation/sendChatFile).

```auto
curl -X POST -H "Authorization: Bearer TOKEN" -F "file=@file.txt" -F "to_channel=CHANNEL_ID" https://file.zoom.us/v2/users/me/messages/files

```

The response is something like this: `curl: (52) Empty reply from server`  
Please help, What shall I do in this situation?

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [July 17, 2023, 7:33pm UTC](https://devforum.zoom.us/t/issues-regarding-file-zoom-us/91878/3 "2023-07-17T19:33:38Z")

</div>

HI @Ns19  
Thanks for reaching out to us and welcome to our community.  
Could you please add “chat” to your path, it should look like this:  
[https://file.zoom.us/v2/chat/users/me/messages/files](https://file.zoom.us/v2/chat/users/me/messages/files)

---

<div class="post-metadata">

**Author:** ![Ns19](https://avatars.discourse-cdn.com/v4/letter/n/eada6e/32.png) [@Ns19](https://devforum.zoom.us/u/Ns19)\
**Post date:** [July 18, 2023, 10:03am UTC](https://devforum.zoom.us/t/issues-regarding-file-zoom-us/91878/4 "2023-07-18T10:03:26Z")

</div>

Thank you @elisa.zoom for the help. But this isn’t working too.

```auto
curl -X POST -H "Authorization: Bearer TOKEN" -F "file=@file.txt" -F "to_channel=CHANNEL_ID" https://file.zoom.us/v2/chat/users/me/messages/files

```

The response is empty. After monitoring properly. I found that the Curl Command hits a `307 Temporary Redirect`

```auto
HTTP/1.1 307 Temporary Redirect
Date: Tue, 18 Jul 2023 09:58:34 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 0
                                      [...SNIP...]
Location: https://us04file.zoom.us/v2/chat/users/me/messages/files
Content-Disposition: attachment

```

And when I follow the redirect, it says Invalid Token. Looking at the `host` I found the primary endpoint is this `us04file.zoom.us.` Is it some issue? Or has the host for file upload API been changed?

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [July 18, 2023, 5:31pm UTC](https://devforum.zoom.us/t/issues-regarding-file-zoom-us/91878/5 "2023-07-18T17:31:51Z")

</div>

Thanks for the update @Ns19  
Let me go ahead and test this on my end.  
Were you able to post the file using this endpoint [us04file.zoom.us](http://us04file.zoom.us).?

---

<div class="post-metadata">

**Author:** ![desautelsj](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/desautelsj/32/23584_2.png) [@desautelsj](https://devforum.zoom.us/u/desautelsj)\
**Post date:** [July 18, 2023, 8:19pm UTC](https://devforum.zoom.us/t/issues-regarding-file-zoom-us/91878/6 "2023-07-18T20:19:38Z")

</div>

@Ns19 I think I have a pretty good idea what the problem is because I have experienced it myself some time ago. I wasn’t using `curl`, but the underlying problem was the same: the bearer token is omitted when a HTTP request is redirected. Let me try to explain:

Most modern HTTP clients have a built-in security feature that prevents authentication information such as username+password or a bearer token to be be included when following a `HTTP 307 Temporary redirect`. This is done to avoid leaking authentication information to a web site that may be different than the site where you sent your original request.

In the case of uploading a file to the Zoom API using curl, the sequence of events is something like this:

- you send a POST request to [https://file.zoom.us/v2/blablabla](https://file.zoom.us/v2/blablabla)
- Zoom responds with `HTTP 307 Location https://us04file.zoom.us/v2/blablabla`
- `curl` follows the redirect but, for security reasons, omits the bearer token
- Zoom throws an exception because there is no bearer token associated with the request

To be clear: this situation is intentional on the part of `curl` in order to avoid leaking sensitive information and also this situation is not specific to `curl`. For instance, I personally experienced this problem with Microsoft’s HTTP client for .NET as I described [here](https://github.com/Jericho/ZoomNet/issues/257). I don’t know for a fact but I’m pretty sure the HTTP client in most modern languages such as Java, Python, etc. behave the same way.

I am no expert on how to use `curl` but I believe there is a way for you to indicate that you allow `curl` to forward the bearer token. This article may be helpful: [How can I instruct curl to reuse credentials after it followed a redirect?](https://superuser.com/questions/936042/how-can-i-instruct-curl-to-reuse-credentials-after-it-followed-a-redirect#:~:text=You%20can%20do%20this%20with%20the%20--location-trusted%20option%3A,available%20from%20curl%20version%207.10.4-pre6%20%2831%20Mar%202003%29.)

Let me know if this helps.
