View Multiple Binary Files(Images)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Arun

    View Multiple Binary Files(Images)

    Hi,

    I have simple question to ask. How to write multiple Binary files to the
    Browser using Asp.Net and Visual C#.net

    I have seen examples where single binary file is written to browser.

    -Regards
    Arun


  • Steven Cheng[MSFT]

    #2
    RE: View Multiple Binary Files(Images)

    Hi Arun,

    Welcome to ASPNET newsgroup.
    As for the writing multi-file to browser, do you mean writing multiple
    file stream into asp.net page's response stream, like we provide file
    downloading functionality? If so, I'm afraid this is not possible because
    the HTTP response has its standard structure which force it should has a
    definite content-type, for example "text/xml" , "text/html",
    "applicatio n/msword"... So we could only contains single stream in each
    response. Even though you can manually write multi file stream into the
    asp.net's response stream and specify a ambigous content-type, the
    clientside browser won't be able to correctly handle it. In addition, I'm
    wondering what's your detailed requirement on this , I think we may try
    looking for some other means to bypass it. If you have any other questions
    or ideas, please feel free to post here. Thanks,

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)



    --------------------
    | From: "Arun" <arun@intersigh tglobal.com>
    | Subject: View Multiple Binary Files(Images)
    | Date: Fri, 2 Sep 2005 11:58:08 +0530
    | Lines: 11
    | X-Priority: 3
    | X-MSMail-Priority: Normal
    | X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
    | Message-ID: <OKO2Hc4rFHA.46 0@TK2MSFTNGP15. phx.gbl>
    | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
    | NNTP-Posting-Host: dsl-kk-070.51.101.203. touchtelindia.n et 203.101.51.70
    | Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP15.phx. gbl
    | Xref: TK2MSFTNGXA01.p hx.gbl
    microsoft.publi c.dotnet.framew ork.aspnet:1219 32
    | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
    |
    | Hi,
    |
    | I have simple question to ask. How to write multiple Binary files to the
    | Browser using Asp.Net and Visual C#.net
    |
    | I have seen examples where single binary file is written to browser.
    |
    | -Regards
    | Arun
    |
    |
    |

    Comment

    • Arun

      #3
      Re: View Multiple Binary Files(Images)

      Hi,

      I want to show two images or more in the browser. That's what I meant by
      multi-file.

      I will give you an example. We would stored many (around 10000) images in
      hard-disk.
      For a particular HTTP request we may have to fetch multiple images(jpg,gif)
      and display it in browser.

      We don't want to keep these images in Virtual Directory.

      Hope you understood our needs.

      -Regards
      Arun



      "Steven Cheng[MSFT]" <stcheng@online .microsoft.com> wrote in message
      news:ujYnLK7rFH A.3540@TK2MSFTN GXA01.phx.gbl.. .[color=blue]
      > Hi Arun,
      >
      > Welcome to ASPNET newsgroup.
      > As for the writing multi-file to browser, do you mean writing multiple
      > file stream into asp.net page's response stream, like we provide file
      > downloading functionality? If so, I'm afraid this is not possible because
      > the HTTP response has its standard structure which force it should has a
      > definite content-type, for example "text/xml" , "text/html",
      > "applicatio n/msword"... So we could only contains single stream in each
      > response. Even though you can manually write multi file stream into the
      > asp.net's response stream and specify a ambigous content-type, the
      > clientside browser won't be able to correctly handle it. In addition, I'm
      > wondering what's your detailed requirement on this , I think we may try
      > looking for some other means to bypass it. If you have any other[/color]
      questions[color=blue]
      > or ideas, please feel free to post here. Thanks,
      >
      > Regards,
      >
      > Steven Cheng
      > Microsoft Online Support
      >
      > Get Secure! www.microsoft.com/security
      > (This posting is provided "AS IS", with no warranties, and confers no
      > rights.)
      >
      >
      >
      > --------------------
      > | From: "Arun" <arun@intersigh tglobal.com>
      > | Subject: View Multiple Binary Files(Images)
      > | Date: Fri, 2 Sep 2005 11:58:08 +0530
      > | Lines: 11
      > | X-Priority: 3
      > | X-MSMail-Priority: Normal
      > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
      > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
      > | Message-ID: <OKO2Hc4rFHA.46 0@TK2MSFTNGP15. phx.gbl>
      > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
      > | NNTP-Posting-Host: dsl-kk-070.51.101.203. touchtelindia.n et 203.101.51.70
      > | Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP15.phx. gbl
      > | Xref: TK2MSFTNGXA01.p hx.gbl
      > microsoft.publi c.dotnet.framew ork.aspnet:1219 32
      > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
      > |
      > | Hi,
      > |
      > | I have simple question to ask. How to write multiple Binary files to the
      > | Browser using Asp.Net and Visual C#.net
      > |
      > | I have seen examples where single binary file is written to browser.
      > |
      > | -Regards
      > | Arun
      > |
      > |
      > |
      >[/color]


      Comment

      • Steven Cheng[MSFT]

        #4
        Re: View Multiple Binary Files(Images)

        Hi Arun,

        Have you had a chance to see my last reply or have you got any progress on
        this issue? If there're anything else we can help, please feel free to post
        here. Thanks,

        Steven Cheng
        Microsoft Online Support

        Get Secure! www.microsoft.com/security
        (This posting is provided "AS IS", with no warranties, and confers no
        rights.)

        --------------------
        | X-Tomcat-ID: 32921182
        | References: <OKO2Hc4rFHA.46 0@TK2MSFTNGP15. phx.gbl>
        <ujYnLK7rFHA.35 40@TK2MSFTNGXA0 1.phx.gbl>
        <#EYGDi7rFHA.20 64@TK2MSFTNGP09 .phx.gbl>
        | MIME-Version: 1.0
        | Content-Type: text/plain
        | Content-Transfer-Encoding: 7bit
        | From: stcheng@online. microsoft.com (Steven Cheng[MSFT])
        | Organization: Microsoft
        | Date: Mon, 05 Sep 2005 02:26:16 GMT
        | Subject: Re: View Multiple Binary Files(Images)
        | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
        | Message-ID: <3Q8bFFcsFHA.12 04@TK2MSFTNGXA0 1.phx.gbl>
        | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
        | Lines: 130
        | Path: TK2MSFTNGXA01.p hx.gbl
        | Xref: TK2MSFTNGXA01.p hx.gbl
        microsoft.publi c.dotnet.framew ork.aspnet:1223 60
        | NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
        |
        | Thanks for your response Arun,
        |
        | For displaying multiple images in webbrowser, currently the only means is
        | through the <img> html element, however, when we use <img> elements in
        our
        | web page, that dosn't means the page which contain the <img> tags will
        | contain all the binary stream of all those referenced images. At runtime,
        | the browser will action like follow:
        |
        | 1. Browser request the web page and retrieve all the html content of that
        | page and rendering in browser.
        |
        | 2. when we meet a <img> tag, it will lookup the "src" link and make new
        | request to the remote server to retrieve image.
        |
        | So, as for your scenario, I think you can consider the following means:
        |
        | 1. Make a custom HttpHandler which will help retrieve image stream from
        | your server's hard disk and write response stream out. Of course, each
        | request can output only a sincle image stream.
        |
        | 2. In your web page, you can use <img> tag to reference image stream
        | through the httphandler's url (with different qureystring parameters
        | according to the image you want to retrieve).
        |
        | Here is a tech article discussing on building such a httphandler in
        asp.net
        | 1.x:
        |
        | #Using ASP.NET HTTP Handlers to create a photo album
        |
        http://www.microsoft.com/belux/nl/ms...et/httphandler.
        | mspx
        |
        | Hope helps. Thanks,
        |
        | Regards,
        |
        | Steven Cheng
        | Microsoft Online Support
        |
        | Get Secure! www.microsoft.com/security
        | (This posting is provided "AS IS", with no warranties, and confers no
        | rights.)
        |
        |
        |
        | --------------------
        | | From: "Arun" <arun@intersigh tglobal.com>
        | | References: <OKO2Hc4rFHA.46 0@TK2MSFTNGP15. phx.gbl>
        | <ujYnLK7rFHA.35 40@TK2MSFTNGXA0 1.phx.gbl>
        | | Subject: Re: View Multiple Binary Files(Images)
        | | Date: Fri, 2 Sep 2005 17:53:11 +0530
        | | Lines: 81
        | | X-Priority: 3
        | | X-MSMail-Priority: Normal
        | | X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
        | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
        | | Message-ID: <#EYGDi7rFHA.20 64@TK2MSFTNGP09 .phx.gbl>
        | | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
        | | NNTP-Posting-Host: dsl-kk-070.51.101.203. touchtelindia.n et 203.101.51.70
        | | Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP09.phx. gbl
        | | Xref: TK2MSFTNGXA01.p hx.gbl
        | microsoft.publi c.dotnet.framew ork.aspnet:1219 86
        | | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
        | |
        | | Hi,
        | |
        | | I want to show two images or more in the browser. That's what I meant by
        | | multi-file.
        | |
        | | I will give you an example. We would stored many (around 10000) images
        in
        | | hard-disk.
        | | For a particular HTTP request we may have to fetch multiple
        | images(jpg,gif)
        | | and display it in browser.
        | |
        | | We don't want to keep these images in Virtual Directory.
        | |
        | | Hope you understood our needs.
        | |
        | | -Regards
        | | Arun
        | |
        | |
        | |
        | | "Steven Cheng[MSFT]" <stcheng@online .microsoft.com> wrote in message
        | | news:ujYnLK7rFH A.3540@TK2MSFTN GXA01.phx.gbl.. .
        | | > Hi Arun,
        | | >
        | | > Welcome to ASPNET newsgroup.
        | | > As for the writing multi-file to browser, do you mean writing multiple
        | | > file stream into asp.net page's response stream, like we provide file
        | | > downloading functionality? If so, I'm afraid this is not possible
        | because
        | | > the HTTP response has its standard structure which force it should
        has a
        | | > definite content-type, for example "text/xml" , "text/html",
        | | > "applicatio n/msword"... So we could only contains single stream in
        | each
        | | > response. Even though you can manually write multi file stream into
        the
        | | > asp.net's response stream and specify a ambigous content-type, the
        | | > clientside browser won't be able to correctly handle it. In
        addition,
        | I'm
        | | > wondering what's your detailed requirement on this , I think we may
        try
        | | > looking for some other means to bypass it. If you have any other
        | | questions
        | | > or ideas, please feel free to post here. Thanks,
        | | >
        | | > Regards,
        | | >
        | | > Steven Cheng
        | | > Microsoft Online Support
        | | >
        | | > Get Secure! www.microsoft.com/security
        | | > (This posting is provided "AS IS", with no warranties, and confers no
        | | > rights.)
        | | >
        | | >
        | | >
        | | > --------------------
        | | > | From: "Arun" <arun@intersigh tglobal.com>
        | | > | Subject: View Multiple Binary Files(Images)
        | | > | Date: Fri, 2 Sep 2005 11:58:08 +0530
        | | > | Lines: 11
        | | > | X-Priority: 3
        | | > | X-MSMail-Priority: Normal
        | | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
        | | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
        | | > | Message-ID: <OKO2Hc4rFHA.46 0@TK2MSFTNGP15. phx.gbl>
        | | > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
        | | > | NNTP-Posting-Host: dsl-kk-070.51.101.203. touchtelindia.n et
        | 203.101.51.70
        | | > | Path:
        TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP15.phx. gbl
        | | > | Xref: TK2MSFTNGXA01.p hx.gbl
        | | > microsoft.publi c.dotnet.framew ork.aspnet:1219 32
        | | > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
        | | > |
        | | > | Hi,
        | | > |
        | | > | I have simple question to ask. How to write multiple Binary files
        to
        | the
        | | > | Browser using Asp.Net and Visual C#.net
        | | > |
        | | > | I have seen examples where single binary file is written to browser.
        | | > |
        | | > | -Regards
        | | > | Arun
        | | > |
        | | > |
        | | > |
        | | >
        | |
        | |
        | |
        |
        |

        Comment

        Working...