anand-harsh / Edumi

Edumi, Place to learn and grow skills with proper maintenance
https://edumi.vercel.app/
9 stars 28 forks source link

[Feature]: Multer Implementation #134

Closed JavidSumra closed 9 months ago

JavidSumra commented 9 months ago

Guidelines

Description

Description: Multer is a popular middleware for handling multipart/form-data, primarily used for uploading files in Node.js applications. While it serves its purpose well, there's a need for enhancing its functionality to better handle scenarios where file uploads need more fine-grained control and flexibility.

Problem

Problem: Currently, Multer lacks certain features that could improve its usability and versatility. Some common pain points include:

  1. File Validation: There's limited support for validating uploaded files based on criteria such as file type, size, dimensions, and custom rules.
  2. Error Handling: Multer's error handling could be more robust, providing clearer error messages and better ways to handle errors gracefully.
  3. Custom Storage Options: Users often require the ability to define custom storage strategies, such as storing files in different locations or integrating with cloud storage services.
  4. Concurrency Control: Multer could benefit from improved concurrency control, especially in scenarios with high file upload traffic, to prevent bottlenecks and optimize performance.
  5. Middleware Composition: Currently, integrating Multer with other middleware can be cumbersome, and there's a need for better compatibility and ease of use in composing middleware stacks.

Proposed Solution

Proposed Solution: To address these issues and enhance Multer's capabilities, the following features and improvements are proposed:

  1. Advanced File Validation: Introduce a comprehensive validation mechanism allowing users to define rules for file type, size, dimensions, and custom validation functions.
  2. Enhanced Error Handling: Improve error reporting with clearer error messages and options for custom error handling middleware.
  3. Custom Storage Providers: Enable users to define custom storage engines, facilitating integration with various storage solutions like cloud platforms or databases.
  4. Concurrency Management: Implement concurrency controls to optimize performance under high load, including options for queuing and parallel processing.
  5. Middleware Integration: Enhance middleware integration with better compatibility and support for composing Multer with other middleware seamlessly.

Alternatives Considered

I think there is no alternative

JavidSumra commented 9 months ago

Hey @anand-harsh Sir I Would Like to Work on this issue Under JWOC 2024

anand-harsh commented 9 months ago

Hi @JavidSumra you need to implement for both backend and frontend

JavidSumra commented 9 months ago

Hey @anand-harsh Sir I think it's required at only two routes am i right?