Javascript 当我想用adonis js在windows操作系统中上传图像时,我发现了这个问题,我该如何解决这个问题
EBUSY:资源正忙或已锁定,复制文件'C:\Users\user\AppData\Local\Temp\ab-4da7f2e2-3f04-4c93-a453-0a71e1304435.tmp'->'F:\nipu\eCommerce\public\images\books\1575106104388.jpeg' 我的代码在这里Javascript 当我想用adonis js在windows操作系统中上传图像时,我发现了这个问题,我该如何解决这个问题,javascript,node.js,express,adonis.js,Javascript,Node.js,Express,Adonis.js,EBUSY:资源正忙或已锁定,复制文件'C:\Users\user\AppData\Local\Temp\ab-4da7f2e2-3f04-4c93-a453-0a71e1304435.tmp'->'F:\nipu\eCommerce\public\images\books\1575106104388.jpeg' 我的代码在这里 const coverImages = request.file('cover_images', { types: ['image'], siz
const coverImages = request.file('cover_images', {
types: ['image'],
size: '2mb'
})
const uploadFolder = Helpers.publicPath('/images/books')
const filePaths = [];
if(coverImages !== null && coverImages.files.length === 3 ){
//Temporary
//filePaths.push(`images/books/default.jpg`);
await coverImages.moveAll(uploadFolder, (file) => {
let newFileName = `${new Date().getTime()}.${file.subtype}`
let newFilePath = `images/books/${newFileName}`
filePaths.push(newFilePath)
return {
name: newFileName,
overwrite: true
}
})
if(!coverImages.movedAll()){
return coverImages.errors()
}
const bookCovers = {
img_1 : filePaths[0],
img_2 : filePaths[1],
img_3 : filePaths[2]
}
bookData.cover_images = JSON.stringify(bookCovers);
}
因为您的识别目录
F:\nipu\eCommerce\public\images\books\
可能无法公开访问
如果您的识别可以公开访问,
通过升级新版本应用此官方修补程序
此问题已报告并关闭
游览