Next.js Discord

Discord Forum

Subject: Implementing File Upload

Unanswered
Sloth bear posted this in #help-forum
Open in Discord
Sloth bearOP
Hi everyone,

I’m looking to implement a feature in my web application where users can upload files, and I need to be able to access these files from the backend. Here are the key details:

Feature Requirement:

File Upload: Users should be able to upload files through the application’s interface.
Backend Access: I need to access these files on the server side for processing, storage, or other purposes.
Technical Considerations:

Storage Solution: What are the best practices for storing user-uploaded files securely?

Implementation:

What technologies or services are recommended for handling file uploads and storage?
Are there any examples or libraries that could simplify the implementation of this feature?
What are the potential security considerations or pitfalls to avoid?
Any guidance, examples, or best practices you can share would be greatly appreciated. Thanks in advance!

Best regards,

19 Replies

I've heard about Uploadthing, but personally never used it.

At work we use digital ocean buckets, I think they use aws s3 under the hood?

For personal/freelance projects, I am currently using bunnycdn... I am unsure if it's good for other files, but I use it to upload images and CDN.
Sloth bearOP
For database I'am using Firebase so I think that Firebase Storage it's better to use because I configure Firebase but maybe there are others solution.
Thank you for answering me !
all you need is s3 at the end of the day
this package can help streamline this entire process
but i also suggest understanding how presigned urls works
for uploading to s3
Sloth bearOP
Ok so for storage it's recommended to use s3 ?
yep
@linesofcode yep
Sloth bearOP
Ok thanks
Using S3 with pre-signed URLs for uploading (uploading directly from the client) is preferred because uploading from the server can have size limits
Sloth bearOP
Ok I will learn about it
Thank you everyone !
Barbary Lion
I created this wonderful package, it has a AWS S3 provider as the guy above here says!

https://www.npmjs.com/package/storageflow

It is inspired by uploadthing and edgestore. But this is self hosted, lightweight and had an temporary feature for uploads.
@linesofcode https://www.npmjs.com/package/next-upload
Barbary Lion
I will suggest this package instead of next-upload. It handles more than only uploading!

https://www.npmjs.com/package/storageflow
Interesting to see another approach. (I’m the creator of next-upload)
@linesofcode Interesting to see another approach. (I’m the creator of next-upload)
Barbary Lion
Aaaaah! feel bad now :meow_peek:
Nah some healthy competition is good for the ecosystem 😊