Hello, I am using reactive spring. Does anyone kno...
# spring
k
Hello, I am using reactive spring. Does anyone know how to put file inside
ServerResponse
? I’m creating excel file by
poi
and I can’t find way to put this file inside ServerResponse
m
Are you need ServerResponse or Mono<ServerResponse>
k
My function is returning Mono<ServerResponse>
m
Copy code
return ServerResponse.ok().json().body(BodyInserters.fromObject("my data class"))
k
I actually want frontend developers to download the file that I created in my server.
m
BodyInserters.from … bra bra bra
ok! download file excel not receive json data from excel
k
Copy code
return ServerResponse.ok().body(BodyInserters.fromResource(FileSystemResource(file.path)))
I succeeded with this
but the result is
image.png
m
omg! hahaha
c
you have to set content type