Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

[85] Binary Files

Last post 06-21-2007 2:43 PM by chenneke. 20 replies.
Page 2 of 2 (21 items) < Previous 1 2
Sort Posts: Previous Next
  • 03-02-2004 2:22 PM In reply to

    Well this thread's ancient, I know that now. Heck, I think I knew back then too, but didn't bother typing it out.
    • Post Points: 0
  • Advertisement

    • Red Gate Software

    Advertisement

    Want to boost your .NET application performance?

    Some developers always seem to write efficient and lightening-fast code. What is their secret? It’s ANTS Profiler. “We improved the performance of the application up to 10 times” Dan Ports, Intrigma.

    Try it for yourself now.

  • 03-03-2004 1:15 PM In reply to

    Well I didn't notice the date in the upper left corner
    • Post Points: 0
  • 05-12-2004 8:03 AM In reply to

    How to generate GIF iamge in ASP from web service

    I am struggling for long time to display a GIF file on an ASP page. I have tried to return a GIF file in  few formats
    from a webservice.
    Webservice returns the images as MemoryStream.GetBuffer(). Its an array of unsigned bytes.I also tried to return it
    in base64 encoded format.

    I can call this webservice in either of 2 ways

    1) Directly from ASP -- It returns me this ..

    ÿØÿàJFIF``ÿÛC    $.' ",#(7),01444'9=82<.342ÿÛC  2!!22222222222222222222222222222222222222222222222222ÿÀ(("ÿÄ ÿĵ}!1A
    Qa"q2‘¡#B±ÁRÑð$3br‚ %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚáâãäåæçèéêñòóôõö÷øùúÿÄ ÿĵw!1
    AQaq"2B‘¡±Á #3RðbrÑ $4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚâãäåæçèéêòóôõö÷øùúÿÚ ?ôp2zW'©øîÒËR‚ XVæ}¢BNçùzž‹SÓ›WÒ
    ®4ô»kG›d)Çð·}§úÃÇ/¬.tÛÉ-nâhæCÈ=Çb=Aõ®zÓ”v=l· FµÜÝßoÔõ‹ïh¶)½äÒ€ÐÃlf-ýÜŽÜœöãšsø–úÍÍ÷†/­ìˆ½ œp99Qøf¹Ï‡ú…•½ôösÀ¿j¹[ÍŒ{§¶G§qŽõéò¬[<Ő„hó '•>Æœ¦¯r1èágìÜ/æßåbµ­ÌW–Ý@áá™w#Û§>‡Ž”Vƒv¦ª[#“
    µû, Oðsÿ ¯çEk sFç"’¥UÁlŽ’$JˆI˜@Î?õÄÇ£Çã+ÍsT™Þ8’e¶´ ç`ã#¾Gç]´D ³m†O¥s> ;4ÛÍ4¡v—R4ÉŽ@ ãÓ*J‰¤ä“:0³•:U*CuoÌó½KK¾ÐuouE2Èã£̧¸¯R±ñ#Iá3â ”òf‰


    2) From VB(again I am returning byte array) which inturn is called by ASP -- I get the
    same junk as above.

    I need to convert it as a GIF file in my ASP page.
    Can you guys suggest how it could by achived. I am open to change code at any layer.

    Note - I am not getting any file back from VB or Web service. I am only getting it in some encoded format(byte array
    or base64)

    My ASP code is like this -

    <%@ LANGUAGE="VBSCRIPT"%>
    <% Response.Expires = 0
    Response.Buffer = True
    Response.clear
    Response.contenttype =  "image/gif"
    Response.AddHeader "content-disposition", "inline; filename=MyMap.gif"

    Set myEXE = CreateObject("ExFireSafeMapInfoTool.MapInfo")
    varGetImage = myEXE.GenerateMapForHousehold()
    RESPONSE.BinaryWrite (varGetImage)

    'Value of varGetImage -- Dont know what format is this?

    ÿØÿàJFIF``ÿÛC    $.' ",#(7),01444'9=82<.342ÿÛC  2!!22222222222222222222222222222222222222222222222222ÿÀ(("ÿÄ ÿĵ}!1A
    Qa"q2‘¡#B±ÁRÑð$3br‚ %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚáâãäåæçèéêñòóôõö÷øùúÿÄ ÿĵw!1
    AQaq"2B‘¡±Á #3RðbrÑ $4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚâãäåæçèéêòóôõö÷øùúÿÚ ?ôp2zW'©øîÒËR‚ XVæ}¢BNçùzž‹SÓ›WÒ
    ®4ô»kG›d)Çð·}§úÃÇ/¬.tÛÉ-nâhæCÈ=Çb=Aõ®zÓ”v=l· FµÜÝßoÔõ‹ïh¶)½äÒ€ÐÃlf-ýÜŽÜœöãšsø–úÍÍ÷†/­ìˆ½ œp99Qøf¹Ï‡ú…•½ôösÀ¿j¹[ÍŒ{§¶G§qŽõéò¬[<Ő„hó '•>Æœ¦¯r1èágìÜ/æßåbµ­ÌW–Ý@áá™w#Û§>‡Ž”Vƒv¦ª[#“
    µû, Oðsÿ ¯çEk sFç"’¥UÁlŽ’$JˆI˜@Î?õÄÇ£Çã+ÍsT™Þ8’e¶´ ç`ã#¾Gç]´D ³m†O¥s> ;4ÛÍ4¡v—R4ÉŽ@ ãÓ*J‰¤ä“:0³•:U*CuoÌó½KK¾ÐuouE2Èã£̧¸¯R±ñ#Iá3â ”òf‰

    %>

    My VB Component function is something like this -

    Public Function GenerateMapForHousehold() As Variant

     Dim szFileName      As String
     Dim oSOAP           As New SoapClient30     'Soap Type Library 3
     Dim bytImage()      As Byte
     Dim szPicture       As String
     Dim iCount          As Integer
     Dim File            As Integer
     File = FreeFile
     
       'Make the Call to Web Service to retrive the Image.
       oSOAP.ClientProperty("ServerHTTPRequest") = True
       oSOAP.MSSoapInit "http://localhost/WebService1/GetImage.asmx?WSDL"
       bytImage = oSOAP.GetImage("bayshore.gif")
       GenerateMapForHousehold3A = bytImage
       
       'I can retreive this image in VB using this code -
       'szPicture = App.Path & "\Test.gif"
       'Open szPicture For Binary As File
       'For iCount = LBound(bytImage) To UBound(bytImage) - 1
       '  Put #1, , bytImage(iCount)
       'Next
       'Close #1
       'GenerateMapForHousehold = szPicture
       'Set Form1.imgTest.Picture = LoadPicture(GenerateMapForHousehold)

    End function


    And web service(c#) method is something like this-

    using System.IO;
    using System.Drawing.Imaging;
    public byte[] GetImage(string strFileName)
           {
               StreamWriter sr;
               Byte sIn = new Byte();
               Image MyImage;
               MemoryStream MemStr = new MemoryStream();
               MyImage = new Bitmap(Server.MapPath( strFileName));
               MyImage.Save(MemStr, ImageFormat.Jpeg);
               return  MemStr.GetBuffer();
           //I have 1 more function to return base64 encoded string but dont know how to use it further.

       }

    Please help.
    Thanks
    Mohit
    e mail - mohitFL@hotmail.com
    • Post Points: 0
  • 05-01-2006 7:34 AM In reply to

    • sampat
    • Not Ranked
    • Joined on 05-01-2006
    • India
    • New Member
    • Points 5

    Re: [85] Binary Files

    I want to read a binary file whitch saved by a Grid Option.how Can i Read this file and retrieve data from file. 

    some quastion
    • Post Points: 5
  • 06-28-2006 10:57 AM In reply to

    • darkside
    • Not Ranked
    • Joined on 06-21-2006
    • Nigeria
    • New Member
    • Points 25

    Re: [85] Binary Files

    Thanks it was very helpfull
    • Post Points: 5
  • 06-21-2007 2:43 PM In reply to

    • chenneke
    • Not Ranked
    • Joined on 06-21-2007
    • United Kingdom
    • New Member
    • Points 5

    Re: [85] Binary Files

    it helps me a lot, thanksBig Smile [:D]

    • Post Points: 5
Page 2 of 2 (21 items) < Previous 1 2