Loading ...
Sorry, an error occurred while loading the content.

ContentLength in BinaryWrite demo

Expand Messages
  • Nikolay Melekhin
    Source of file binary_write.htm: QueryString( type ) eq gif ) { $Response- {ContentType} = image/gif ; open(FILE,
    Message 1 of 2 , Oct 3, 2002
    View Source
    • 0 Attachment
      Source of file binary_write.htm:
      <%
      use File::Basename;

      if($Request->QueryString('type') eq 'gif') {
      $Response->{ContentType} = 'image/gif';
      open(FILE, 'test.gif') || die "can't open test.gif";
      binmode FILE;
      $/ = undef;
      my $data = <FILE>;
      $Response->{ContentLength} = length $data;
      $Response->Clear;
      $Response->BinaryWrite($data);
      $Response->End();
      } else {
      %>

      But I am not found any reference to ContentLength property
      in Apache::ASP doc.

      --
      Best regards, Nikolay Melekhin mailto:nikolay_melehin@...


      ---------------------------------------------------------------------
      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    • Josh Chamas
      ... Good catch, its a mistake in the example & I will fix it up to use the AddHeader method instead. Thanks, Josh
      Message 2 of 2 , Oct 3, 2002
      View Source
      • 0 Attachment
        Nikolay Melekhin wrote:
        > Source of file binary_write.htm:
        >
        > But I am not found any reference to ContentLength property
        > in Apache::ASP doc.

        Good catch, its a mistake in the example & I will fix it up
        to use the AddHeader method instead.

        Thanks,

        Josh
        ________________________________________________________________
        Josh Chamas, Founder phone:925-552-0128
        Chamas Enterprises Inc. http://www.chamas.com
        NodeWorks Link Checking http://www.nodeworks.com


        ---------------------------------------------------------------------
        To unsubscribe, e-mail: asp-unsubscribe@...
        For additional commands, e-mail: asp-help@...
      Your message has been successfully submitted and would be delivered to recipients shortly.