Hey guys,
We've been using FS.Collection for a quite a while now. Recently, we decided to add a new store to an existing collection. (so that next to 'normal' and 'original' we'll have a 'small' store). Now upon deploying, 0-byte 'images' are put into the newly created bucket. Additionally, for every existing image, Fileworker ADDED - calling deleteChunks for <_id> is called. This seems to clog the working memory of the host.
Fact of the matter is that we can't deploy as our memory quota keeps exceeding. Is there any way we could work around this? Any help would be greatly appreciated.
Mick
Images.insert(...
from the frontend is great for in this case I have already the binary data in a var in the backend. How do I write it to a file? CollectionFS can help me with that?
<template name="hello">
Add Files<br>
<form class="input">
<input type="text" id="theName" name="theName"/>
<span class="btn btn-default btn-file">
<input multiple class="file fileInput" type="file"/>
</span>
<input type="submit" value="Add To Collection"/>
</form>
<br>
{{#each uploads}}
<br>
User: {{email}}
<br>
Filename: {{name}}
<br>
Description: {{theName}}
<br>
<a class="btn btn-primary" href="{{url download=true}}">Download</a>
<br>
{{/each}}
</template>
Template.hello.events({
'submit form': function(event, template){
event.preventDefault();
var theName = event.target.theName.value;
FS.Utility.eachFile(event, function(file){
var currentUserId = Meteor.userId();
var fileObj = new FS.File(file);
fileObj.itemtext = theName;
fileObj.userId = currentUserId;
fileObj.email = Meteor.user().emails[0].address;
Uploads.insert(fileObj, function(err){
console.log(err);
})
})
}
Hi all, have a strange problem
var image = Images.findOne({_id: photo._id});
var url = image.url("Images");
console.log(image);
onsole.log(image.url("Images"));
url method returns null, but when i set a timeout it returns url (image displays fine)
anybody knows where is a problem?
MongoError: auth failed