fs.writeFile() doesn't work on Meteor 0.6.5.1 -
i using meteor 0.6.4.1 , used npm.require('fs')
, fs.writefile()
to save files. here code used test it: gist save files. updated meteor 0.6.5.1 , got error:
(stderr) app/server/save_file.js:18 (stderr) throw (new meteor.error(500, 'failed save file. ' + err)); (stderr) ^ (stderr) error: failed save file. error: enoent, open 'public/carlos.png' [500] (stderr) @ meteor.methods.savefile (app/server/save_file.js:18:16) (stderr) @ fs.writefile (fs.js:746:21) (stderr) @ object.oncomplete (fs.js:297:15)
i know node version changed 0.8.18 0.8.24 on meteor 0.6.5. it's bug on 0.8.24 node version or meteor 0.6.5 version? it's there way solve or must stay 0.6.4.1 meteor version?
in meteor 0.6.5, changed current working directory in server context, used meteor root directory myproject/.meteor/local/build/programs/server
.
so if want access in public folder server side app, try path : ../../../../../public/
.
warning : writing files public
might cause server restart , lead undefined behaviour.
Comments
Post a Comment