Skip to content
Back

API Uploading

  • 0
  • Storage
WhMonkey
19 Nov, 2024, 21:45

Hello!

I'm currently using the REST API to upload large JPEG files to an Appwrite storage bucket via a microcontroller, but I'm encountering an issue where the server does not return a response after I send the HTTP POST request with the multipart/form-data content. I ensure the Content-Length header is correctly calculated, and I stream the file data in manageable chunks to conserve memory. Despite this, the connection either freezes or times out without a server response. Could you clarify if there are specific requirements or best practices for handling file uploads through the REST API, such as chunked uploads, timeout settings, or required headers? Additionally, are there known cases where the API might not return a response under certain conditions, and how can I troubleshoot or resolve this?

TL;DR
Developers are inquiring about uploading to the API rather than using an SDK. A suggestion is made to mimic SDK behavior for chunk uploading. Information about maximum chunk size is also discussed. The developer is having issues with large JPEG file uploads via the REST API, as the server does not return a response. Specific requirements, best practices, chunked uploads, timeouts, required headers, and troubleshooting tips are requested to resolve this issue. Recommended resources provided.
Eldad
19 Nov, 2024, 21:47

You have some information and examples here: https://appwrite.io/docs/apis/rest#files

Eldad
19 Nov, 2024, 21:47

I don't remember what is exactly the max allowed chunk size the server will accept. @dlohani do you recall what is the number?

Eldad
19 Nov, 2024, 21:49

@WhMonkey another thing you can do is mimic the SDKs behavior, they are already designed to handle chunk uploading for bigger files. Then, also take into consideration that file size is limited on Cloud depending on your plan.

Eldad
19 Nov, 2024, 21:49

Also, just from curiosity, why do you upload directly to the API and not just use one of the SDKs?

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