My FeedDiscussionsHashnode Enterprise
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more
50BytesOfJohn

25 likes

·

835 reads

2 comments

Андрей Епанешников
Андрей Епанешников
Jul 23, 2024

How did you resolve server action size limit? As I know size limit is around 2 mb

·
·1 reply
50BytesOfJohn
50BytesOfJohn
Author
·Jul 24, 2024

Hey, this limit is not Next.js limit, but the hosting provider limit. You probably think about Vercel which has 4.5MB request body size limit for serverless function.

In most cases it should be sufficient for avatars, and even images. But may decrease UX in case of content like galleries or posts, since many of images may have more than the limit (most of Unsplash images for example).

In this case, there are few options, one of them would be to use pre-signed URLs, that are for sure supported with S3 but, I'm not sure if bunny supports it, I know they do for CDN file access, but haven't seen it for uploading.

This way is also described in Vercel guide: vercel.com/guides/how-to-bypass-vercel-bod…

Other way, may be to just deploy a simple server that would handle only file uploading for your app. If you have time, and want to bother with it, for free or for some 1-3$ monthly, you should be able to do it.

You can also try to host Next.js with some other hosting provider with higher limits.

1
·