chaudhuree / FileUploaderInNextjsWithoutPlugins

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Description

This is a nextjs 13 file uploader project with auto image resizer. I have not used any third party plugins like formidable, multer or sharp.

Key fearutes

  • Auto image resize during upload.

  • You can upload any type of file.

  • Image preview. When clicked upload button, If the file is an image, the resized image will be shown below the upload button. nextjs Image upload Preview

  • Uploaded file information from server. nextjs file upload info

  • Image resize option is provided to set the quality of image resize. Its value is between 0-1. Default value is 0.6 which means resize the original image by 60%

const resized = await imageResizer(SelectedImageFile, 0.6);
//Here original SelectedImageFile will be resized by 60%.
  • This imageResizer() function returns original image information and resized image information. nextjs resized image information

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev

Open http://localhost:3000 with your browser to see the result.

About


Languages

Language:JavaScript 94.0%Language:CSS 6.0%