Closed benoitkopp closed 2 years ago
Is your form create a file type to generate a multi-part form?
$this->Form->create($entity, ['type' => 'file']);
?
Yes :)
The plugin configuration seems to have some errors.
You're configuring the field meetings_statement_files
but that field doesn't exist in the model. Maybe you want to use name
instead.
Also, you might intend to use path
instead of dir
.
I have found that when you add multiple files like that you should put the following in controller, not sure if this was intended way to do it:
`$data = $this->request->getData();
if(isset($data['article_attachments'])){ $attachments = $data['article_attachments']; unset($data['article_attachments']); foreach($attachments as $attachment){ $data['article_attachments'][]['attachment'] = $attachment; } }
$article = $this->Articles->patchEntity($article, $data,['associated' => ['ArticleAttachments']]);`
Hello, I used the plugin to upload some single files and it worked perfectly. I'm trying to upload multiple files in one time, but I'm not able to make it work.
My Parent Table MeetingsStatements:
My Child Table MeetingsStatementFiles:
In my CakePHP MeetingsStatementsTable:
In my CakePHP MeetingsStatementFilesTable:
I wrote my input like:
<input type="file" name="meetings_statement_files[]" multipe >
My relations are pretty good set, I can save and delete the MeetingsStatementFiles entries depending on the MeetingsStatements but the uploads are still not working.
What am I doing wrong ?
Thanks.