1
  public async create({ request, response }: HttpContextContract) {
    try {
      await request.multipart
        .onFile(
          'file',
          {
            size: '900mb',
          },
          async (file, reportChunk) => {
            await Drive.putStream(`teste/${file.filename}`, file.file, {
                contentType: file.file.type,
                visibility: 'private',
              })
          }
        )
        .process()
      return response.ok(request.multipart.state)
    } catch (error) {
      console.log(error)
    }
  }

Route receives multipart file and it does not work. Tryna do this https://docs.adonisjs.com/guides/direct-file-uploads with s3 driver but not working.

1 Answers1

0

You didn't post here the error you're generating so it's a little difficult to know what's going on.

I faced a recent problem with the adonis driver and I only managed to solve it after I updated my package.json.

Add this to it and see if it solves it

 "overrides": {
     "@adonisjs/drive-s3": {
       "@aws-sdk/client-s3": "3.190.0",
       "@aws-sdk/lib-storage": "3.190.0"
     }
   }

https://github.com/adonisjs/drive-s3/issues/15#issuecomment-1447284517