You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 14, 2019. It is now read-only.
@raix, I spent some time trying to debug this, but I can't figure it out. When you do a server side insert of filepath or URL, there is a RangeError stack size exceeded error. It's something within the tempstore writestream code (I think), but I don't know what. It must be something different about the internal: true code because it doesn't happen when streaming to a normal store (or when chunks are coming over from the client).
It doesn't matter what SAs you use because it never gets that far. The file appears for a second in the _tempstore but then disappears and 'stored' never fires.
The text was updated successfully, but these errors were encountered:
I'm getting this error when I store FS.File reference to collection.
RangeError: Maximum call stack size exceeded
I created FS.File from base64 buffer using following code:
var post = Post.find({id: postId});
var dataUrlRegExp = /^data:image\/\w+;base64,/;
for (var i in images) {
var imageBuffer = new Buffer(images[i]['data'].replace(dataUrlRegExp, ""), "base64");
var newFile = new FS.File();
newFile.attachData(imageBuffer, {type: 'image/png'}, function(error){
if(error) throw error;
newFile.name(images[i]['dataId'] + '.png');
Images.insert(newFile, function(err, fileObj) {
if (err == null) {
Post.update({ _id: postId },{ $push: { images: fileObj }})
}
});
});
}
Images and Post declaration.
var imageStore = new FS.Store.FileSystem("images", { path: "~/uploads/images" });
Images = new FS.Collection("images", {
stores: [
imageStore
],
filter: {
allow: {
maxSize: 3145728, // max file size 3MB
contentTypes: ['image/*'] // allow only images in this FS.Collection
}
}
});
Post = new Mongo.Collection('posts');
If I store image id to images property of the Post collection, it works fine. But I have to store the FS.File reference to get the URL easily.
@raix, I spent some time trying to debug this, but I can't figure it out. When you do a server side insert of filepath or URL, there is a RangeError stack size exceeded error. It's something within the tempstore writestream code (I think), but I don't know what. It must be something different about the
internal: true
code because it doesn't happen when streaming to a normal store (or when chunks are coming over from the client).Running this on the server, you will see it:
It doesn't matter what SAs you use because it never gets that far. The file appears for a second in the _tempstore but then disappears and 'stored' never fires.
The text was updated successfully, but these errors were encountered: