L
L
Luchifer2018-08-03 10:10:54
Yii
Luchifer, 2018-08-03 10:10:54

How to implement in Yii2 on one ActiveRecorde 3 photo upload?

There is such a problem. on one ActiveRecord, you need to upload 3 photos separately, since my template is such that uploading all 7 photos to one fileinput and splitting it doesn’t work, 1 was done with actionCreate Update , one was hung on beforeSave . 1 left, I don't know how to implement it. with controller (

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2018-08-03
@Luchifer

all these inputs will send one photo at a time, there will be 3 in total. If you need to send several, then the name should not be "photo", but 'photo[]' to get an array of files, not 1 file.
what?
what? What's the difference where you implemented the download? The main thing is how you implemented it, at least in beforeValidate, what does it have to do with it?
Do you think that if one file is loaded in beforeSave, then the second one cannot be loaded there? Why doesn't everything in beforeSave load? Why did you scatter the same logic in different places?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question