I'm having some issues with cut off files. Can someone please confirm, is this going to complete the upload before returning my response? What can be done to fix it?
const router = require('koa-router')(),
koaBody = require('koa-body')({
multipart: true,
formLimit: 2000 * 1024,
formidable: {
uploadDir,
},
})
router.post('/uploadImage', koaBody, function *() {
const {fields, files} = this.request.body
const f = files['files[]']
const {username} = fields
// console.log('uploadImage', username, f.path, f.name)
if(res.status !== 200) {
this.status = res.status
this.statusText = res.statusText
return
}
const {ipfspath} = yield res.json()
const url = 'https://example.com' + ipfspath
this.body = {files: [{url}]}
})
export default router.routes()