Giter Site home page Giter Site logo

regards limits in multer about multer HOT 10 CLOSED

expressjs avatar expressjs commented on April 20, 2024
regards limits in multer

from multer.

Comments (10)

hacksparrow avatar hacksparrow commented on April 20, 2024

The unit it specified in bytes. I am not following your first question.

from multer.

harmnprt avatar harmnprt commented on April 20, 2024

thanks bro. where we can get answer for that ?

from multer.

Fishrock123 avatar Fishrock123 commented on April 20, 2024

@harmnprt Is this what you are looking for? How you set it?

app.use(multer({
  limits: {
    maxFileSize: <defaults to Infinity>
  }
}

from multer.

harmnprt avatar harmnprt commented on April 20, 2024

this can't block the file that is bigger than limit. this store that file but crupted and size of file equals to maxFileSize. is it correct ?

from multer.

tsenmu avatar tsenmu commented on April 20, 2024

As far as i understand, you are correct. The limit is supposed to truncate the size of the file instead of blocking files exceeding this limit. When the file exceeds the file size limit, the flag truncated in an file object should be set to true. As of now, this functionality has not been implemented. When the file starts to be uploaded, the truncated flag is null, the truncated flag will not be set to either to true or false whatsoever, but undefined for some reason. I think it is a feature has not been supported yet.

from multer.

harmnprt avatar harmnprt commented on April 20, 2024

okk, is there have any other to limit on file, in server side over this ?

from multer.

tsenmu avatar tsenmu commented on April 20, 2024

I think you can raise the fileSize in limit, detect the file size before file is uploaded, detect the file size when the data is being uploaded, and somehow halt the uploading once it exceeds the fileSize limit you desire. I tried but failed, do tell me if you succeed!

from multer.

harmnprt avatar harmnprt commented on April 20, 2024

thanks for reply. trying if success giving you reply

from multer.

hacksparrow avatar hacksparrow commented on April 20, 2024

Now you can add a handler for onFileSizeLimit to detect file size limit exceeds and take necessary action.

from multer.

kudresov avatar kudresov commented on April 20, 2024

It doesn't seem to trigger onFileSizeLimit when limit is hit. At least for me. I could upload a sample if necessary.

from multer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.