403 Forbidden When Uploading Excel via API

Hi, Team

When I upload a Excel file through the website page, it succeeds. After downloading the uploaded file locally, renaming it, and attempting to re-upload it via the API, the system returns a 403 forbidden error.

I then uploaded another Excel file via both the web page and API, and both attempts succeeded.

Why does this happen?

The API endpoint for uploading Excel files is: https://onlyoffice.[mytestdomain].com/api/2.0/files/{folderId}/upload

Hello @jm.zhang,
We would need more details to be able to help. Please clarify the following:

  1. What version of the product is used? (in case of Workspace, what version of Document Server and Community Server components)
  2. Does the issue occur with the particular file?
  3. Is the issue reproduced if you upload the file not using API but via the interface?

Hi, @DmitriiV

Thanks for your reply.

  1. Product version is “12.1.0.1760”
  2. Yes, the issue only occurs when uploading via the API. I’m not sure what the differences are between the files. If I open the problematic Excel file locally, do nothing except press Ctrl+S, and then re-upload it via the API, everything works fine.
  3. No, everything works fine via the interface.

If the issue occurs with a particular file, please provide the file