0
在前端使用react和react-router,node +表示爲我的後端,cloudinary存儲我的映像文件。將blob上傳到Cloudinary
遇到的問題林是,cloudinary API方法斜面似乎打開/解析該圖像存儲在數據blob
{ images: { preview: 'blob:http://localhost:8080/19526dcc-b67d-4697-b112-e5480de61d03' } }
cloudinary.v2.uploader.upload(body.images.preview, function(result) {
console.log(result)
})
錯誤響應:
{ Error: ENOENT: no such file or directory, open 'blob:http://localhost:8080/e7f30c71-7e06-4c36-801f-49666e9df053'
at Error (native)
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: 'blob:http://localhost:8080/e7f30c71-7e06-4c36-801f-49666e9df053'
}
如果不知道是由於反應路由器的問題,還是應該將數據轉換爲其他格式?
路線是這樣的:
app.use('/api/', posts);
app.use('/api/', users);
app.use(express.static(staticPath));
app.use('/', express.static(staticPath));
app.use('/posts/*', express.static(staticPath));
app.use('/new/*', express.static(staticPath));
app.use('/validateEmail/*', express.static(staticPath));