Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload example is not working #46

Open
rikyperdana opened this issue Nov 15, 2016 · 6 comments
Open

Upload example is not working #46

rikyperdana opened this issue Nov 15, 2016 · 6 comments

Comments

@rikyperdana
Copy link

I build an example project with example-upload.yaml,
when I insert an item with a jpg file, it creates one record on gallery collection,
but it stores and empty string on fileId. Is there something wrong?

@rikyperdana
Copy link
Author

Finally worked,
When the browser console says 'Reference Error event is undefined',
I open the Template.events and change param 'event' to 'e' according to the parent function
It gives me headache for about 2 days :D

@rikyperdana rikyperdana changed the title Upload example not working Upload example is not working Nov 18, 2016
@perak
Copy link
Owner

perak commented Nov 18, 2016

@rikyperdana sorry for my unresponsiveness - being busy with other things these days.

Please give me more details: is it bug in the generated code, or is bug with your custom code? If it is bug with the generator, please copy & paste part of the file, I will fix it and deploy in next version.

Thanks!

@rikyperdana
Copy link
Author

rikyperdana commented Nov 23, 2016

When i run the example-upload project, and upload something, the firefox browser console says this
ReferenceError: event is not defined [Learn More]
I remove the whole project and rebuild it to know what's goin' on

When i run
meteor-kitchen kitchen-examples/example-upload
It generates a whole project with upload/client/views/home/insert/insert.js like this
FS.Utility.eachFile(event, function(file) {

But when i change it with
FS.Utility.eachFile(e, function(file) {
It works perfectly fine :)

Just replaced param 'event' to 'e'
And i think it comes from the generator itself, so i need to fix it everytime i run the generator

@perak
Copy link
Owner

perak commented Nov 23, 2016

@rikyperdana ok, thanks! Fixed and will be available in the next version.

@rikyperdana
Copy link
Author

If i may add one more thing, in the example-upload/client/views/home/home.js
the template.events click .delete-file function only remove the Gallery collection with
callback: function() { Gallery.remove({ _id : self._id }); }

And when i run meteor mongo and run db.cfs_gridfs.files.files.find()
It shows that it still contains the blocks of file i just removed before.

Can you make it so the function remove both file information document and it's gridfs blocks simultaneusly? :)

@perak
Copy link
Owner

perak commented Nov 23, 2016

@rikyperdana Ah... OK, I'll fix that too. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants