vsivsi / meteor-file-collection

Extends Meteor Collections to handle file data using MongoDB gridFS.
http://atmospherejs.com/vsivsi/file-collection
Other
159 stars 37 forks source link

how to implement an input file button #42

Closed sembrador closed 9 years ago

sembrador commented 9 years ago

Hi,

Excelent package!

Excuse me if I seem too silly but I'm wondering how to implement an input file button to choose a file for upload with this package.

HTML

<template name="testform">
    <input type="file" name="image" class="imageFile">
</template>

Javascript

Template.testform.events({
    submit: function(e, t) {
        e.preventDefault();
        // Submit Code Here...
    },
    "change .imageFile": function(e, t) {
        e.preventDefault();
        // Upload Code Here ???
    }
});

Can you give me, please, some sample code to bring me in the right direction.

Regards.

vsivsi commented 9 years ago

Hi, something like this should work:

myFiles.resumable.assignBrowse($(".imageFile"));

You can find more about this in the documentation for resumable.js.

amitkumargaur2012 commented 9 years ago

Hi Sir, I have downloaded the code "https://github.com/vsivsi/meteor-file-job-sample-app" Actually images are not showing in the image gallery.