mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
fix stream .ons
This commit is contained in:
parent
11087cbaef
commit
02a29cc954
@ -114,10 +114,11 @@ const localFileUpload = ({ createReadStream, uniqueFilename }) => {
|
||||
const destination = `/uploads/${uniqueFilename}`
|
||||
return new Promise((resolve, reject) =>
|
||||
createReadStream()
|
||||
.pipe(createWriteStream(`public${destination}`))
|
||||
.on('finish', () => resolve(destination))
|
||||
.on('error', reject),
|
||||
)
|
||||
.pipe(createWriteStream(`public${destination}`)
|
||||
.on('finish', () => resolve(destination))
|
||||
.on('error', (error) => reject(error))
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
const s3Upload = async ({ createReadStream, uniqueFilename, mimetype }) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user