The website i created has a upload button for user to upload their image, but after all the image are uploaded, it cannot be displayed. Here is my code:
The upload part does not have any problem, and i can find all my images from database.
I follow the documentation from :
[https://github.com/VeliovGroup/Meteor-Files/wiki/Template-Helper]
At the display thumbnail part i change from findOne to find, change their collection name to mine and write an Each statement to iterate through collection to get every image in the collection to display in HTML. Well actually i don’t really understand much from the documentation so please help guide me and thanks very much. If i miss anything or made anything mistake in this post, please tell and i will correct it.
I already solved the problem, but i think this is not a practical way to do it, but here is the step i did: I first tested to display only one images, according to doc, I have to create a helper template:
As it works to appear only 1 image, i try to console findOne().link() to see where it is from, then i extract the path and change only the id of each images so then i could display it all now, and here’s the code:
The http:…storage/ is the path i extracted from the link() that i found, /images is the collection name and {{_id}} is the id of each images, /original is the folder that store the images, follwow along with image id + their extension, i found the extensionWithDot property by doing console log the findOne then you will see the object and all the properties there.
Im having the sam issue as you. More or less the same code. But I cannot get more than one picture. Moreover, when I try to iterate album, I get this error:
Error: {{#each}} currently only accepts arrays, cursors or falsey values.
But Im not referring anymore to fineOne, but to find(). Still doesn’t seem I get an array. or whats wrong? Any clue anybody?