Skip to content
Back

Unable to create a file larger than 1048325 bytes

  • 0
  • Self Hosted
  • Functions
  • Storage
pgk1124
24 Jan, 2025, 11:26

Hi, I am trying to use the API to upload files into a bucket on a self hosted instance.

The files are generally around 1-2MB and I retrieve them from an external server via get requests.

Since they are already a byte array, I use InputFile.from_bytes to create the file.

I can create the small files, but I keep getting a "413 Request Entity Too Large" response for all files larger than 1084325 bytes

I don't see the reason for this limit/how I can bypass it.

Here is a code snippet showing the file size limitation content = (("x" * 1048325).encode()) ###All values greater than 1048325 result in the error storage.create_file(bucket["$id"], ID.unique(), file=InputFile.from_bytes(content, "temp_file_name"))

The documentation states that the file size limit is around 5MB, and this is nowhere near it.

Is this a known issue and how can I resolve it?

TL;DR
Developers are unable to create files larger than 1048325 bytes when using the API to upload files into a bucket on a self-hosted instance. They receive a "413 Request Entity Too Large" response for files larger than 1084325 bytes. The file size limit should be around 5MB, so this is unexpected. Solution: This issue may be related to server-side configuration settings for file upload limits. Developers should check and adjust these settings in their self-hosted instance to allow for larger file uploads.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more