End-point to support the file upload


(Joo) #1

Can anyone please show how to create the end-point that accepts the file upload, please?

I found the following example but not quite sure how to relate this to Lagom, but this example deviates from the general Lagom practice and uses Play framework’s controller to handle the file.

https://www.playframework.com/documentation/2.6.x/ScalaFileUpload

If I create an end-point definition with the following Request type that accepts the array of bytes, will it work?

case class IdentityDocument(documentType: IdDocumentType,
                            willSendLater: Boolean,
                            document: Array[Byte])

Thanks,


(Alan Klikic) #2

@lejoow there is one lagom Recipe describing this use case


(Joo) #3

thanks Alan. I saw this too but I am looking for more Lagom native solution for it. ie. without having to create a separate play controller if possible.


(Alan Klikic) #4

@lejoow lagom is not designed for file upload use case and this is a reason why there is no Lagom native way.