Skip to content

Not able to use load Function on Windows, it works perfectly fine on Ubuntu LTS 14 #184

@salmanhasni

Description

@salmanhasni

This is the error
W20160813-01:37:37.669(5)? (STDERR) stream.js:74
W20160813-01:37:37.724(5)? (STDERR) throw er; // Unhandled stream error in pipe.
W20160813-01:37:37.724(5)? (STDERR) ^
W20160813-01:37:37.724(5)? (STDERR)
W20160813-01:37:37.724(5)? (STDERR) Error: ENOENT: no such file or directory, open 'E:\wcif.meteor\local\build\programs\server\assets\app\uploads\Images\Hc42Pg6kigDj9PpSh.jpg?oh=36b427001c86a63a8b53819e99aa7000&oe=584DDFBE&gda=1478129990_b368aeadf01e50a998b8c20c9270fd0b'
W20160813-01:37:37.725(5)? (STDERR) at Error (native)

here is my code

Shared Code

this.Images = new FilesCollection({
    collectionName: 'Images',
    allowClientCode: false, // Disallow remove files from Client
    onBeforeUpload: function (file) {
        // Allow upload files under 10MB, and only in png/jpg/jpeg formats
        if (file.size <= 10485760 && /png|jpg|jpeg/i.test(file.extension)) {
            file.uploadedAt = new Date();
            return true;
        } else {
            return 'Please upload image, with size equal or less than 10MB';
        }
    }
});

Server Code

var getQuestionImage = function(url, questionId){
    if(url){
        Images.load(url, {
            meta : {
                questionId: questionId
            }
        });
    }
};

Meteor.startup(function(){
    if(Meteor.settings.allowScrapping) {
        getQuestionImage (<dont bother this, parameters having no issues>);
    }
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions