Git Product home page Git Product logo

Comments (4)

CTOlet avatar CTOlet commented on July 29, 2024

Does it work if you set the rules inside app config?

'modules' => [
    ...
    'attachments' => [
        'class' => nemmo\attachments\Module::className(),
        'rules' => [ // Rules according to the FileValidator
            'maxFiles' => 10, // Allow to upload maximum 3 files, default to 3
            'mimeTypes' => 'image/png', // Only png images
            'maxSize' => 1024 * 1024 // 1 MB
        ],
    ]
    ...
]

But I think it will not work. Thus it will be an enhancement. Added to checklist #36

from yii2-attachments.

adiramardiani avatar adiramardiani commented on July 29, 2024

Yes I did not try it inside the app config
But what kind of method that can do that ?

It's so I need at this moment, if you could explain a temporary method that allows this currently ? while I waited for the enhancement

Thanks

from yii2-attachments.

CTOlet avatar CTOlet commented on July 29, 2024

You can fork or download the whole module and add this feature inside file behavior. I think the right way is to check the file existance on before save event

from yii2-attachments.

adiramardiani avatar adiramardiani commented on July 29, 2024

Sorry, add this feature inside file behavior or check the file existance on before save event, I can't understand how to write it, I was newbie, can you also explain the example code.

(While waiting in the newest version for the best method)

from yii2-attachments.

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.