Azure got 413 response when uploading larger image

名扬 袁 1 Reputation point
2021-12-03T02:48:56.85+00:00

Hi guys. I'm currently using @azure/storage-blob js package to handle Azure blob stuff. I would get 413 response when I try to upload a large single image(about 10mb, actually not big at all) from my website production. But everything just went well on my local development(localhost:3000) no matter how big the file is. Do you have ideas on how to solve this problem? Thanks a lot.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,082 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sumarigo-MSFT 47,486 Reputation points Microsoft Employee
    2021-12-03T07:44:21.797+00:00

    @名扬 袁 Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    Can you check the destination path is correct?
    For testing purpose: Can you try to upload using Azcopy or Azure Storage explorer tool and let me know the status
    Check the container access level"https://learn.microsoft.com/en-us/azure/storage/common/authorization-resource-provider"

    Assume that you try to write more than 4 megabytes (MB) of data to a file on Azure Storage, or you try to upload a file that's larger than 4 MB by using the SAS url (REST API) or HTTPS PUT method. In this scenario, the following error is returned:

    Code : RequestBodyTooLarge
    Message: The request body is too large and exceeds the maximum permissible limit.
    RequestId:<ID>
    MaxLimit : 4194304

    Cause: There's a 4-MB limit for each call to the Azure Storage service. If your file is larger than 4 MB, you must break it in chunks. For more information, see Azure Storage scalability and performance targets.

    Additional information: Are you trying to upload a range which is larger than 4MB? If so, please split the request into multiple requests as the API doc mentions : https://learn.microsoft.com/en-us/rest/api/storageservices/put-blob

    Please let us know if you have any further queries. I’m happy to assist you further.

    ----------

    Please do not forget to 154648-image.png and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.