0

I need to store multiple images uploaded on my database in different field in db.

I upload all images and then through POST method I insert data on db. The first image works but second no.

All field of images have name=image.

<input class="cloudinary-hidden-field" type="hidden" name="image" data-cloudinary-public-id="g4002uhktsiqr7ucg8e2" value="image/upload/v1475179093/g4002uhktsiqr7ucg8e2.jpg#b898624e496e9ba9ce936eba7bc72571be3baa52">
Al Foиce ѫ
  • 4,195
  • 12
  • 39
  • 49
Fabio Krueger
  • 65
  • 1
  • 8

1 Answers1

0

You can change the name of the generated hidden fields using the data-cloudinary-field attribute on the file-upload field, e.g.:

<input name="file" type="file" class="cloudinary-fileupload" data-cloudinary-field="image[]" multiple="multiple" />

When submitting the form, this will result in an array sent over to the server.

I think this should solve the issue.

Nadav Ofir
  • 778
  • 4
  • 6