Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / July 2005

Tip: Looking for answers? Try searching our database.

Returning Binary File. Please Help!!!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
klj_mcsd@hotmail.com - 12 Jul 2005 20:16 GMT
I get the file in the webservice like this.

bImage = New Bitmap("C:\Inetpub\wwwroot\images\GR4001.PNG")
                   'Save as PNG file
                   bImage.Save(bFile,
System.Drawing.Imaging.ImageFormat.Png)
                   'Return Binary file in a byte array
                   Return bFile.GetBuffer()

Now I call the webservice like this.

Response.ContentType = "image/png"
Set objHTTP = Server.CreateObject("Msxml2.ServerXMLHTTP")
' Point to an image file with adequate access permissions granted
objHTTP.open "GET",
"http://localhost/wsImage/wsImage.asmx/GetSpecimenImage", false
objHTTP.send
Response.BinaryWrite objHTTP.ResponseBody
Set objHTTP = Nothing

Nothing appears in the browser window but I get the binary back. Please
Help
Keenan Newton - 12 Jul 2005 22:02 GMT
I am willing to bet you are sending some HTML before the binary image.
Try this.

*******************
Response.Buffer = true
Response.Clear()

'Do the rest of your code here.

*******************

You could also look at using HttpResponse.Outputstream to stream out
the binary image.  

Just some ideas.
klj_mcsd@hotmail.com - 13 Jul 2005 02:37 GMT
Did that and it still does not work. Any more suggestions will be
greatly appreciated

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.