我正在從這個yeoman.io生成器搭建一個MEAN堆棧腳手架的站點:https://github.com/DaftMonk/generator-angular-fullstack,我試圖以二進制形式上傳一些圖像文件到MongoDB。這裏是我的項目混帳回購協議:如何通過Mongoose在MongoDB中存儲二進制數據(PNG)?
https://github.com/peter-atlanta/personal-site
我跟着@ aheckmann的GIST的嘴臉:https://gist.github.com/aheckmann/2408370,
,但我一直對我有多麼的文件不能被發現收到錯誤,即
Error: ENOENT, no such file or directory '../../client/assets/images/github.png'
at Error (native)
at Object.fs.openSync (fs.js:500:18)
at Object.fs.readFileSync (fs.js:352:15)
at Immediate.<anonymous> (/Users/peterward/petergrayward/blog/server/config/imageToMongo.js:43:21)
at Immediate._onImmediate (/Users/peterward/petergrayward/blog/node_modules/mongoose/node_modules/mquery/lib/utils.js:137:16)
at processImmediate [as _immediateCallback] (timers.js:358:17)
由此可見,雖然,有問題的PNG位於該目錄中,我甚至已經試過目錄服務器端移動無濟於事。
爲什麼找不到文件/目錄入口點?