Storing value on the server side on Startup()


#1

In my app I have a functionality to upload an image. I want that if the user doesn’t upload any image, the default gets uploaded. I have thought of storing the image in some folder and on the startup() the image must get store on the server side then I will fetch the id of the image so as to upload it as a defaut image as for e.g in the following code.

Template.modelView.helpers({
    thumbImg:function()
    {
    thumbImage = ThumbFiles.findOne({gFile:this._id});
        if (thumbImage) {
            return thumbImage;
        } else {
            // Return StartupImage id here
        }
    }
})

I have followed the question on the stackoverflow. I am getting the same error as mentioned there but I am unable to understand how to resolve it.


#2

I have a public folder on client side, but yet it is not working. It is not the picking the static link. I followed the link. But this is not working. Any idea what to do.