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.
-
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.
-
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 is a Next.js project bootstrapped with create-next-app
.
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.