My web app consists of images stored in the SQL Server db. And, i have a silverlight app on the client side. The web app would allow clients to download file from the server by triggering the download in the silverlight app. The Silverlight talks to the web service to download the file.
I am trying to understand the file download logic on the web service end. I could come up with following approaches:
1) Read the data from db to memory. Write memory data to a file on server. Return the server path to client. The client would invoke HtmlPage.Window.Navigate method with the url to prompt the user to download the file.
Disadvantage of the approach:
- Data from db needs to be written to file every time to download. Multiple simultaneous file download requests could clog the hard drive space on web server.
Is there any other approach to download the file? Does usage of FILESTREAM provide any better alternatives?
Appreciate your response!