---
title: "Discussion on \"Next.js and Bunny CDN: Complete Guide to Image Uploading with Server Actions\" | Hashnode"
description: "Discussion on \"Next.js and Bunny CDN: Complete Guide to Image Uploading with Server Actions\". Learn to upload images efficiently using Next.js and Bunny CDN. Integrate UI libraries and enhance your web projects with ease"
url: "https://hashnode.com/posts/nextjs-and-bunny-cdn-complete-guide-to-image-uploading-with-server-actions/66242d9568bea2eeb380f496"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Next.js and Bunny CDN: Complete Guide to Image Uploading with Server Actions](https://50bytesjournal.hashnode.dev/nextjs-and-bunny-cdn-complete-guide-to-image-uploading-with-server-actions?utm_source=hashnode&utm_medium=feed)

Learn to upload images efficiently using Next.js and Bunny CDN. Integrate UI libraries and enhance your web projects with ease

Apr 20, 2024 · 11 min read · 50bytesjournal.hashnode.dev  
Read the article

-   [#valibot](https://hashnode.com/tag/valibot)
-   [#nextjs](https://hashnode.com/tag/nextjs)
-   [#bunnycdn](https://hashnode.com/tag/bunnycdn)
-   [#shadcn](https://hashnode.com/tag/shadcn)
-   [#shadcn-ui](https://hashnode.com/tag/shadcn-ui)
-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#react-hook-form](https://hashnode.com/tag/react-hook-form)
-   [#image-processing](https://hashnode.com/tag/image-processing)
-   [#file-upload](https://hashnode.com/tag/file-upload)

## Written by

[50BytesOfJohn](https://hashnode.com/@50BytesOfJohn)

@50BytesOfJohn · Poland

  
[View profile](https://hashnode.com/@50BytesOfJohn)

Full-stack developer, coffee lover ofc, and fan of T1

## Responses 2

Markdown supported · ⌘↵ to post

[Андрей Епанешников](https://hashnode.com/@Iepo)

[Jul 23, 2024](https://hashnode.com/posts/nextjs-and-bunny-cdn-complete-guide-to-image-uploading-with-server-actions/66242d9568bea2eeb380f496/comment/66a033fac1f9a239c1296b8a)

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

[50BytesOfJohn](https://hashnode.com/@50BytesOfJohn)

[Jul 24, 2024](https://hashnode.com/posts/nextjs-and-bunny-cdn-complete-guide-to-image-uploading-with-server-actions/66242d9568bea2eeb380f496/comment/66a033fac1f9a239c1296b8a#reply-66a0afcf1e08b586709f77be)

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-body-size-…](https://vercel.com/guides/how-to-bypass-vercel-body-size-limit-serverless-functions#upload-directly-to-the-source)

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.
