Comments (7)
Покажите конфиг виджета и конфиг бехейвора.
from yii2-file-kit.
'fileStorage' => [
'class' => '\trntv\filekit\Storage',
'baseUrl' => '@storageUrl/source',
'filesystem' => [
'class' => 'common\components\filesystem\LocalFlysystemBuilder',
'path' => '@storage/web/source'
],
'as log' => [
'class' => 'common\behaviors\FileStorageLogBehavior',
'component' => 'fileStorage'
]
],
Из стартеркита..
Ну а в форме:
>widget(
Upload::classname(),
[
'url' => ['logo-upload'],
]
)
Если в UserProfile из Стартер Кита добавить такие поля (name, type...) - тоже самое произойдет..
Я те конфиги вообще скинул?)
from yii2-file-kit.
Вижу, сейчас разберемся
а нет, не вижу :-)
from yii2-file-kit.
То есть $_POST уходит правильно, судя по первому сообщению, а в модель сохраняется неправильно?
Покажите еще функцию behaviors()
из вашей модели
from yii2-file-kit.
Сейчас я в чистом Starter Kit..
public function behaviors()
{
return [
'picture' => [
'class' => UploadBehavior::className(),
'attribute' => 'picture',
'pathAttribute' => 'avatar_path',
'baseUrlAttribute' => 'avatar_base_url'
]
];
}
Я добавил поля type,name в модель UserProfile для проверки. Сохранил модель, и собственно эти поля заполнились данными с файла..
from yii2-file-kit.
А POST приходит правильный..
from yii2-file-kit.
Теперь можно сделать так:
'picture' => [
'class' => UploadBehavior::className(),
'attribute' => 'picture',
'pathAttribute' => 'avatar_path',
'baseUrlAttribute' => 'avatar_base_url',
'typeAttribute' => false,
'sizeAttribute' => false,
'nameAttribute' => false,
'orderAttribute' => false
]
from yii2-file-kit.
Related Issues (20)
- Bug: Upload widget allow multiples files via drag and drop
- AWS S3 A sha256 checksum could not be calculated
- Javascript events
- single file does not support image preview
- Problem with multi-upload - saved first and last image
- Errors with popover as alternative
- Get rid of bootstrap? HOT 1
- uploadKit with multi sub domain HOT 1
- loading more than 2 files HOT 8
- Enh add config property on save file
- Upload widget does not work with javascript HOT 9
- Maybe somebody can write this widget by vueJs? HOT 1
- It seems trntv\filekit\widget\Upload rendered incorrectly in modal dialog HOT 1
- Upload from Mobile Device Cameras HOT 3
- Image variations HOT 1
- Error message translations HOT 1
- Why after upload file, generate folder "1" ? HOT 2
- How to make dynamic uploadPath ? HOT 2
- How to add seo fields ?
- Upload file not working on Iphone
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-file-kit.