Comments (4)
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.
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.
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.
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)
- Fyi: Similar extension. HOT 1
- Upload single file
- Thumbnail style view HOT 3
- How to add dynamic location
- when uploaded file has no extension upload failes (type cannot be empty in model)
- array_slice() expects parameter 1 to be array, object given HOT 4
- Problem when using AR in console HOT 1
- AttachmentsInput and AttachmentsTable do not display
- Configuration of migration HOT 1
- Failed to hide initialPreview
- Event afterUpload
- Yii2 attachment module not found
- How to get the url to the already uploaded image HOT 1
- How to copy (duplicate) attachments from one model to another?
- Possibility of attaching files to the model with possible errors
- Open file instead of download HOT 1
- Replace saving short model name with full
- Problem with drag & drop with new version of fileinput
- Calling multiple saves of the model on same request raises Exception
- 404 page not found .....?r=attachments%2Ffile%2Fupload
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yii2-attachments.