Help to use S3 on controller #1383
-
I have a controller that when registered the user I have to upload his photo in aws s3, all the data comes with the form, to save the local photo it works, but to send to s3 it doesn't send, i already tried to use the bodyparser .processManually and request.multipart.file but it doesn't suit my UC, I'm also trying this way from the code below which is what doesn't upload too `
} |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
Do you get any error or anything? const Drive = use('Drive')
Route.post('upload', async ({ request }) => {
request.multipart.file('profile_pic', {}, async (file) => {
await Drive.disk('s3').put(file.clientName, file.stream)
})
await request.multipart.process()
})
|
Beta Was this translation helpful? Give feedback.
-
to understand your use-case properly. You want to use same route for both uploading image and some form data. right? If you want to use same route for uploading image along with some form field you should do the following:
Let me know if I have misunderstood your use-case. |
Beta Was this translation helpful? Give feedback.
-
Quite confused, what's the problem you are having. But here's potential solution if I understood it correctly: Add |
Beta Was this translation helpful? Give feedback.
to understand your use-case properly. You want to use same route for both uploading image and some form data. right?
If you want to use same route for uploading image along with some form field you should do the following: