0

I have an array like this :

thumbnailUrls[
0:{name: "1583146805644103424047.jpg", url: "http://localhost/app/public/images/xxx/58906245-4…1088da69ae3e/thumbnail_1583146805644103424047.jpg"}
1: {name: "1583146961187129982793.jpg", url: "http://localhost/app/public/images/xxx/58906245-4…1088da69ae3e/thumbnail_1583146961187129982793.jpg"
]

if i call on console thumbnailUrls[0]['url'] it shows the correct url: http://localhost/app/public/images/xxx/58906245-4756-4319-a706-1088da69ae3e/thumbnail_1583146805644103424047.jpg

but if i do this on dropzone js

  for (var i = 0; i < thumbnailUrls.length; i++) {
            var mockFile = { 
                name: thumbnailUrls[i]['name'], 
                size: 12345, 
                type: 'image/jpg', 
                status: Dropzone.ADDED, 
                url: thumbnailUrls[i]['url'] 
            };

            Dropzone.emit("addedfile", mockFile);

            Dropzone.emit("thumbnail", mockFile, thumbnailUrls[i]);

            Dropzone.files.push(mockFile);
        }

it gives the url with [object%20Object] like this:

http://localhost/app/listing/58906245-4756-4319-a706-1088da69ae3e/[object%20Object]

José Neves
  • 130
  • 1
  • 1
  • 9
  • Can you upload the images to imgur instead? The images are showing a 404 error. – Terry Mar 02 '20 at 12:14
  • The link (image) is just to see that when i do console.log thumbnailUrls[0]['url'] it shows the correct link, when i do the cycle for it shows with the [object%20Object] – José Neves Mar 02 '20 at 12:17
  • I don't know the dropzone API but shouldn't the last parameter to `emit` be `thumbnailUrls[i].url` instead of `thumbnailUrls[i]`? – TiiJ7 Mar 02 '20 at 12:19
  • thumbnailUrls[i].url return the same result link with the [object%20Object] – José Neves Mar 02 '20 at 12:26

0 Answers0