Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 317067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:26:30+00:00 2026-05-12T08:26:30+00:00

My web app consists of images stored in the SQL Server db. And, i

  • 0

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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T08:26:30+00:00Added an answer on May 12, 2026 at 8:26 am

    Since you’ve already got the DB with the images in the DB I’ll gloss over the whole “should I store images in the DB question”. I only mention it here because I’m sure that others will comment on it and dock me points for not mentioning that it’s not the best idea. I’ll just answer your question as best I can.

    You can have a web service return an image directly. It’s fairly straightforward…

    Here’s a code snippet from a web service I wrote just to see if you can do it. Hopefully, you can modify it for your needs.

    <WebMethod()> _
        Public Function GetImage() As Byte()
            Try
                Dim outStream As New System.IO.MemoryStream
                Dim REturnValue As New System.Drawing.Bitmap(500, 500)
                Dim g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(REturnValue)
                'g.RotateTransform(5)
                Dim f As New System.Drawing.Font(System.Drawing.FontFamily.GenericMonospace, 16, Drawing.FontStyle.Regular, Drawing.GraphicsUnit.Point)
                Dim b As System.Drawing.Brush = Drawing.Brushes.Lime
    
                g.DrawString("Hello", f, b, 0, 0)
                g.DrawString("Would you like to play a game? (Y/N)", f, b, 0, 40)
                g.DrawString("> Y", f, b, 0, 80)
                g.DrawString("Loading Global Thermonuclear War,", f, b, 0, 120)
                g.DrawString("please wait...", f, b, 0, 160)
                REturnValue.Save(outStream, System.Drawing.Imaging.ImageFormat.Jpeg)
    
                Return outStream.ToArray()
            Catch ex As Exception
                Throw New Exception(ex.ToString())
            End Try
    
        End Function
    

    and then the Asp.Net page that displays the image..

     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Dim ts As New TestServices
            Dim b As System.Drawing.Bitmap
            Dim bytes As Byte()
            Dim inStream As System.IO.MemoryStream
    
            bytes = ts.GetImage()
            inStream = New System.IO.MemoryStream(bytes)
            b = New System.Drawing.Bitmap(inStream)
            Response.ContentType = "image/jpeg"
            b.Save(Response.OutputStream, b.RawFormat)
            b.Dispose()
        End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a J2EE/JSF-based web-app. It consists of an form-input, a text display and
I'm writing application which consists of server side on Google App Engine (Java) and
I have a standalone PHP web app which consists of several pages in a
We are developing an app that consists of a web server that hosts a
I have a Java web app which consists of a variety of a servlets
My web app solution consists of 3 projects: Web App (ASP.NET MVC) Business Logic
I am working on a iPad ordering web app at the moment which consists
I'm working in a web app framework, and part of it consists of a
I'm developing an offline web-app for a client of ours, designed to run on
I am using Tomcat 5.5 with a web-app that consists of plug-ins. One of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.