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

Publish uploading file without overpublishing #51

Closed
Neobii opened this issue Jul 17, 2015 · 5 comments
Closed

Publish uploading file without overpublishing #51

Neobii opened this issue Jul 17, 2015 · 5 comments

Comments

@Neobii
Copy link

Neobii commented Jul 17, 2015

Files need to be published automatically that are being uploaded because overpublishing will of course publish a lot of unnecessary data.

@serkandurusoy
Copy link

Hm, actually I was wondering the same thing.

Are there any best practices or patterns to ensure we publish just enough for the uploads to work?

Otherwise, publishing the whole store is a bad idea for many reasons.

@Tycale
Copy link

Tycale commented Aug 17, 2015

You can use the owner field :
https://github.com/yogiben/meteor-autoform-file/blob/master/lib/client/autoform-file.coffee#L58

Meteor.publish 'publishName', ->
  collection.find({owner: @userId})

@mpowaga
Copy link
Collaborator

mpowaga commented Aug 17, 2015

Uploaded file will be automatically published by autoform-file. Is that not working for you?

@serkandurusoy
Copy link

@Tycale that would still publish all the files belonging to a user.

@mpowaga I don't understand what you mean. If I don't publish the collection manually, I can't see the uploaded image file on the insert form.

Edit:
Please disregard this. I've just realized I've switched to a fork (for materialize theme) and that fork is behind in commits. It does not publish the uploaded file.

@Tycale
Copy link

Tycale commented Aug 18, 2015

Yes, you're right.
In fact, it works now without "publish/subscribe".
I use Meteor-starter and I had to change manually the version of this packet from 0.2.7 to 0.2.9.

@mpowaga mpowaga closed this as completed Oct 5, 2015
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

4 participants