What is the fastest way to return the binary of a file?

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default What is the fastest way to return the binary of a file?

    Currently this is what I'm doing and it takes about 30 - 60 seconds for
    88 kb file to show in my web browser from my web service. I think that
    is too long when you webservive is on a network server. Can someone
    look at this please. Thanks

    bImage = New Bitmap("c:\images\" & arrImages(ImageNo).ToString)
    'Save as PNG file
    bImage.Save(bFile, System.Drawing.Imaging.ImageFormat.Png)
    'Return Binary file
    Return bFile.GetBuffer()



    When I get is from the web service I just display it using

    Response.ContentType = "image/png"
    ms = New MemoryStream(x)
    Response.OutputStream.Write(x, 0, Convert.ToInt32
    (ms.Length))

    klj_mcsd@hotmail.com Guest

  2. Similar Questions and Discussions

    1. How can I return a binary file (image) from a web service
      A url to an image file will be passed to my web service. What function can I use that will get the image and return the image in binary form? ...
    2. Binary file IO
      Hi, What I would like to do is load a file's contents from a file on the server and put the contents into a record in a database. For this I...
    3. How to get binary file from SQL field?
      I want to display binary data from SQL server 2000 in an asp page. The data comes from a Windows Sharepoint Services document library. The raw...
    4. Why can't I create a binary file ?
      open FH, ">1.txt"; binmode FH; binmode STDOUT; print FH "123m,zxnc,mzxnc,mzncm,zxc"; close FH; Why the output still a text file ?
    5. return binary content from within ASPX page
      my aspx page gets binary data with ms-word file. (just byte array). I want this data to send back to the browser, but when i try to do this with...
  3. #2

    Default Re: What is the fastest way to return the binary of a file?

    [email]klj_mcsd@hotmail.com[/email] wrote in news:1121725105.064218.29520@o13g2000cwo.googlegro ups.com:
    > Currently this is what I'm doing and it takes about 30 - 60 seconds for
    > 88 kb file to show in my web browser from my web service. I think that
    > is too long when you webservive is on a network server. Can someone
    > look at this please. Thanks
    Web services by default encode binary data as base 64, this expands its size. You need to look at
    DIME, etc to change the transport to binary.


    --
    Chad Z. Hower (a.k.a. Kudzu) - [url]http://www.hower.org/Kudzu/[/url]
    "Programming is an art form that fights back"

    Blogs: [url]http://www.hower.org/kudzu/blogs[/url]
    Chad Z. Hower aka Kudzu Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139