i newbie user of meteor. using file picker apis , can upload files there server , give me unique url in return . when comes again fetch file creating problem me .
you can tell me how file using url using filepicker api . can tell me how use url , image , using meteor when upload picture filepicker.io return me json object following
[{"url":"https://www.filepicker.io/api/file/kirtnvqrta7gxlfvfip2","filename":"brazil.jpg","mimetype":"image/jpeg","size":2660,"key":"zml3ojrftvyv4wabzrit_brazil.jpg","iswriteable":true}]
so how image on meteor? thank in advance
the normal image source should work:
<template name="image"> <img src="{{img}}"/> </template>
and javascript give url
template.image.img = function() { var yourfilepickerjson = [{"url":"https://www.filepicker.io/api/file/kirtnvqrta7gxlfvfip2","filename":"brazil.jpg","mimetype":"image/jpeg","size":2660,"key":"zml3ojrftvyv4wabzrit_brazil.jpg","iswriteable":true}] return yourfilepickerjson[0] && yourfilepickerjson[0].url; }
you pass filepickerjson via session
object reflected reactively it
Comments
Post a Comment