RE: Response.BinaryWrite or something causes multiple posts

Discussion in 'ASP .Net' started by =?Utf-8?B?QnJhZCBSb2JlcnRz?=, Aug 19, 2004.

  1. Is this using DynamicPDF? If so, I may be able to help.

    "Dan C" wrote:

    > I think this is probably going to be an obscure problem nobody has seen, but
    > I'll give it a shot.
    >
    > I have two pages in a system. the first:
    > 1) queries a database and builds a pdf file using a third party control
    > 2) writes the pdf to a file
    > 3) redirects to the second page.
    >
    > the second page
    > 1) reads the file written by the first page in to a FileStream
    > 2) writes the contents to a byte array
    > 3) Response.BinaryWrite's the byte array
    > 4) File.Delete's the file
    >
    > the reason I am doing it this way are that the third-party pdf generator
    > causes a security warning when trying to write directly to the response
    > stream, but I don't want the file sitting around forever. I know there are
    > other ways, but I want to know why this particular one won't work.
    >
    > there are two ways the first page is accessed, through a Response.Redirect,
    > and through an html anchor with a target of "_blank". when the browser
    > navigates to the first page through the Redirect, everything works
    > beautifully. the first page writes the pdf, the second page reads it, writes
    > the contents, and deletes it without any problems.
    >
    > however, when the first page is accessed through an anchor with the _blank
    > target, there are problems because, somehow, two http requests are generated
    > for the second page. the first request, I assume, works fine. the pdf file
    > does get read and deleted. but somewhere in the process, the browser issues
    > another request, and since the file has been deleted by the first request,
    > the page doesn't work. the second request does not have the http_referrer set
    > in the post, and it is not a post back.
    >
    > does that make sense to anybody? and why would that happen?
    >
    > thanks for any insight you might have!
    =?Utf-8?B?QnJhZCBSb2JlcnRz?=, Aug 19, 2004
    #1
    1. Advertising

  2. nope, aspEasyPDF from http://www.mitdata.net/.

    "Brad Roberts" wrote:

    > Is this using DynamicPDF? If so, I may be able to help.
    >
    > "Dan C" wrote:
    >
    > > I think this is probably going to be an obscure problem nobody has seen, but
    > > I'll give it a shot.
    > >
    > > I have two pages in a system. the first:
    > > 1) queries a database and builds a pdf file using a third party control
    > > 2) writes the pdf to a file
    > > 3) redirects to the second page.
    > >
    > > the second page
    > > 1) reads the file written by the first page in to a FileStream
    > > 2) writes the contents to a byte array
    > > 3) Response.BinaryWrite's the byte array
    > > 4) File.Delete's the file
    > >
    > > the reason I am doing it this way are that the third-party pdf generator
    > > causes a security warning when trying to write directly to the response
    > > stream, but I don't want the file sitting around forever. I know there are
    > > other ways, but I want to know why this particular one won't work.
    > >
    > > there are two ways the first page is accessed, through a Response.Redirect,
    > > and through an html anchor with a target of "_blank". when the browser
    > > navigates to the first page through the Redirect, everything works
    > > beautifully. the first page writes the pdf, the second page reads it, writes
    > > the contents, and deletes it without any problems.
    > >
    > > however, when the first page is accessed through an anchor with the _blank
    > > target, there are problems because, somehow, two http requests are generated
    > > for the second page. the first request, I assume, works fine. the pdf file
    > > does get read and deleted. but somewhere in the process, the browser issues
    > > another request, and since the file has been deleted by the first request,
    > > the page doesn't work. the second request does not have the http_referrer set
    > > in the post, and it is not a post back.
    > >
    > > does that make sense to anybody? and why would that happen?
    > >
    > > thanks for any insight you might have!
    =?Utf-8?B?RGFuIEM=?=, Aug 19, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DAC
    Replies:
    1
    Views:
    1,789
    Steve C. Orr, MCSD
    Jul 31, 2003
  2. bruce barker
    Replies:
    2
    Views:
    629
    bruce barker
    Aug 19, 2004
  3. =?Utf-8?B?QnJhZCBSb2JlcnRz?=

    RE: Response.BinaryWrite or something causes multiple posts

    =?Utf-8?B?QnJhZCBSb2JlcnRz?=, Aug 19, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    489
    =?Utf-8?B?QnJhZCBSb2JlcnRz?=
    Aug 19, 2004
  4. spmm#

    Response.BinaryWrite question

    spmm#, Nov 3, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    9,510
    rdevalco
    Mar 23, 2013
  5. Replies:
    1
    Views:
    819
Loading...

Share This Page