meteor-file-collection icon indicating copy to clipboard operation
meteor-file-collection copied to clipboard

Show files on meteor 1.3 cordova

Open vacarsu opened this issue 9 years ago • 4 comments

Hi , in the examples it shows how to show files in cordova in meteor 1.2 (http://meteor.local). Is there any examples for meteor 1.3 which uses localhost:app_id/ ? Doesn't seem to show images out of the box.

Here is my collection -

export var Images = new FileCollection('images', {
  resumable: true,
  baseURL: '/gridfs/images',
  http: [
    {
      method: 'get',
      path: '/:md5',
      lookup: function (params, query) { 
        return { md5: params.md5 };
      }
    }
  ]
});

finding images and trying to display them with <img src="{{'/gridfs/images/'+image.md5}}"/> doesn't work in cordova.

vacarsu avatar May 24 '16 07:05 vacarsu

Hi, all of the Cordova support has been contributed by users of this package. I'm not a Cordova developer, so I have no ability to develop or test Cordova specific features. As always, I'm open to PRs for this kind of thing...

vsivsi avatar May 24 '16 19:05 vsivsi

@vacarsu

when you can upload file or image on desktop browser, you can easily display image by add below code

{
  method: 'get'
  path: '/:md5'
  lookup: (params, query) ->
    return { md5: params.md5 }
  handler: (req, res, next) ->
    console.log 'get'
    res.setHeader 'Access-Control-Allow-Origin', '*'
    res.setHeader 'Access-Control-Allow-Credentials', true
    do next
}

but the hardiest part is how you can upload image on ios

crapthings avatar Jun 29 '16 10:06 crapthings

@crapthings Thanks for the info!

vsivsi avatar Jun 29 '16 16:06 vsivsi

this is a working cordova ios example

https://github.com/crapthings/meteor-photo

the ios can upload file by using input(type='file')

https://github.com/vsivsi/meteor-file-collection/issues/90#issuecomment-207639130

crapthings avatar Jun 30 '16 01:06 crapthings