I'm trying to create a collection of images using the CollectionFS in meteor. I used the following code from https://github.com/CollectionFS/Meteor-CollectionFS/wiki/Insert-One-File-From-a-Remote-URL
var url='data/2.jpg';
var newFile = new FS.File();
newFile.attachData(url, function (error) {
if (error) throw error;
newFile.name("testImage.jpg");
Images.insert(newFile, function (error, fileObj) {});
});
The above code is written in the startup function in the 'js/server.js' file & the image it is referring to is 'js/data/2.jpg'.
But it doesn't seem to work & throws the this error:
Error: ENOENT, stat 'C:\Users\[username]\WebstormProjects\test\.meteor\local\build\programs\server\data\2.jpg'