---
title: "Discussion on \"3 Ways to Upload Files to Google Cloud Storage with NextJS and Formidable\" | Hashnode"
description: "Discussion on \"3 Ways to Upload Files to Google Cloud Storage with NextJS and Formidable\". Hello all. Today we will discuss three methods to upload files in your NextJS app. Each method has its specific use case, so read until the end.\nTo get started, I have created a basic page where the user can upload a file to a /api/upload endpoint.\n\n..."
url: "https://hashnode.com/posts/3-ways-to-upload-files-to-google-cloud-storage-with-nextjs-and-formidable/6367a8f44eeb55c059f20425"
---

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

Discussion

# [3 Ways to Upload Files to Google Cloud Storage with NextJS and Formidable](https://cs310.hashnode.dev/3-ways-to-upload-files-to-google-cloud-storage-with-nextjs-and-formidable?utm_source=hashnode&utm_medium=feed)

Hello all. Today we will discuss three methods to upload files in your NextJS app. Each method has its specific use case, so read until the end. To get started, I have created a basic page where the user can upload a file to a /api/upload endpoint. ...

Nov 6, 2022 · 5 min read · cs310.hashnode.dev  
Read the article

-   [#google](https://hashnode.com/tag/google)
-   [#nextjs](https://hashnode.com/tag/nextjs)
-   [#apis](https://hashnode.com/tag/apis)
-   [#typescript](https://hashnode.com/tag/typescript)

## Written by

[Wool Doughnut](https://hashnode.com/@WoolDoughnut310)

@WoolDoughnut310 · UK

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

Teenage software developer

I am a developer with 7 years of experience. At the moment I am working on building cool projects with JavaScript and the web for people to enjoy.

## Responses 2

Markdown supported · ⌘↵ to post

[noone here](https://hashnode.com/@ertewr)

[Aug 30, 2024](https://hashnode.com/posts/3-ways-to-upload-files-to-google-cloud-storage-with-nextjs-and-formidable/6367a8f44eeb55c059f20425/comment/66d1d44936ac081bdc1478b8)

hello could you tell us where is this file at, cause the import just appeared in the code import formidable from "./formidable-serverless"

[Wool Doughnut](https://hashnode.com/@WoolDoughnut310)

[Aug 30, 2024](https://hashnode.com/posts/3-ways-to-upload-files-to-google-cloud-storage-with-nextjs-and-formidable/6367a8f44eeb55c059f20425/comment/66d1d44936ac081bdc1478b8#reply-66d1e110cda65c0576bdeaa3)

I put the file at [github.com/WoolDoughnut310/nextjs-gcs/blob/main/l…](https://github.com/WoolDoughnut310/nextjs-gcs/blob/main/lib/formidable-serverless.js) , which I think I had taken from [github.com/Amit-A/formidable-serverless/blob/mast…](https://github.com/Amit-A/formidable-serverless/blob/master/lib/index.js)

[Derick Zihalirwa](https://hashnode.com/@Qaizer)

[Aug 11, 2023](https://hashnode.com/posts/3-ways-to-upload-files-to-google-cloud-storage-with-nextjs-and-formidable/6367a8f44eeb55c059f20425/comment/64d66c92d459393b57af7bf3)

Hello there. Greate Article. I have a question tho, -Does this implementation works in production too?

[Wool Doughnut](https://hashnode.com/@WoolDoughnut310)

[Aug 14, 2023](https://hashnode.com/posts/3-ways-to-upload-files-to-google-cloud-storage-with-nextjs-and-formidable/6367a8f44eeb55c059f20425/comment/64d66c92d459393b57af7bf3#reply-64da14dc4429385b927ff5e1)

Hi. My main focus for deploying this NextJS app was on serverless environments like Vercel, hence `formidable-serverless`. So if the setup doesn't work, and you don't need to deploy to a serverless platform, you could try replacing `formidable-serverless` with the original `formidable`. Alternatively, a 4th method could involve generating a signed URL for uploading in an API route. Subsequently, a PUT request can be sent from the frontend to that signed URL that includes the user's file. I may update the article with this 4th method, but for now, see [github.com/googleapis/nodejs-storage/blob/main/sa…](https://github.com/googleapis/nodejs-storage/blob/main/samples/generateV4UploadSignedUrl.js)

[Derick Zihalirwa](https://hashnode.com/@Qaizer)

[Aug 14, 2023](https://hashnode.com/posts/3-ways-to-upload-files-to-google-cloud-storage-with-nextjs-and-formidable/6367a8f44eeb55c059f20425/comment/64d66c92d459393b57af7bf3#reply-64da160d4429385b927ff640)

Thanks for your quick reply: I think I manage to make it work. i created a new method [Joseph Nma](https://hashnode.com/@WoolDoughnut310) you can check what what I changed here : [shorturl.at/bdrw8.](https://shorturl.at/bdrw8.) Let me know if there's anything wrong with my implementation. Thanks
