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

Duplications #2

Open
SergeC opened this issue Jun 22, 2013 · 4 comments
Open

Duplications #2

SergeC opened this issue Jun 22, 2013 · 4 comments

Comments

@SergeC
Copy link

SergeC commented Jun 22, 2013

Hi. I've just installed this package, added template from "File Uploader Part 9: Build a UI Component" article, but in console I getting error "Uncaught Error: There is already a helper 'FileUploader' evaluate.js:70". If I rename "FileUploader" helper, I get another error "Uncaught Error: There is already a helper 'humanize' evaluate.js:70
Handlebars.registerHelper evaluate.js:70
(anonymous function) newDeal.js:163
(anonymous function) newDeal.js:168"

newDeal.js:163:
Handlebars.registerHelper('humanize', function (number, options) {

newDeal.js:168:
}).call(this); //this added by Meteor

Please check it out and let me know results.
Thanks.

@cmather
Copy link
Owner

cmather commented Jun 22, 2013

Hi @SergeC, Those functions were added to the package in the file uploader file. Are you duplicating the logic? If you were following along in the videos, I was showing my steps to building up the controls, but the final code is in the package itself. So you don't need to create a humanize or FileUploader handlebars helper.

@SergeC
Copy link
Author

SergeC commented Jun 22, 2013

OK, now I have installed package and html template. When I try to upload something I get an error:
"Name Size Upload Progress Status
hma.pl 1452 0% Error: Method not found [404]"

Console log is empty.

Thanks.

@SergeC
Copy link
Author

SergeC commented Jun 22, 2013

Added new file on the server side with code:
Meteor.methods({ uploadFile: function(file){ file.save('./public/'); } });

Now all is OK.

I think it's reasonable to add beforeUpload method to process files before upload (compress, resize images etc.) and afterUpload method to save files with unique filenames.

Another question. How can I allow to upload only jpg and png files? How to save files on server with unique filenames?

Thanks.

@EnchanterIO
Copy link

@SergeC aaah i was missing the server side code now it works great! Thx BTW: i am going to use this package for image upload so when i will be done i will show you the code.

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

3 participants