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

K

klj_mcsd

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))
 
C

Chad Z. Hower aka Kudzu

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top