1

I need to pass through a file from another service, via my application and to the client(because of security reasons). Do anyone have any idea how I can start to create such an endpoint?

Lets say the file is on http://192.168.0.2/file.pdf and I want this to be accessible through my .net core 2 backend via my endpoint http://myfantasticservice.com/file.pdf (a proxy kind of)

Do I need to download the .pdf first and then provide it to the client. I'm thinking the best thing would be to just store it in memory before passing it on.

Happy to hear your ideas :)

Numm3n
  • 1,021
  • 2
  • 9
  • 26
  • 1
    Download the file into a stream. Then serve the stream as per https://stackoverflow.com/a/42460443/34092 . – mjwills Mar 22 '18 at 12:00
  • Thank you mjwills. I tried to search for the answer without any luck, happy that others have better google skills than me :) – Numm3n Mar 22 '18 at 12:10
  • You could create two client. One for each file. It depends on the amount of memory, how long it takes to download if it is better to download all the data or use two clients and then look up each value as needed. – jdweng Mar 22 '18 at 12:10

0 Answers0