Apache-ASP

 view release on metacpan or  search on metacpan

ASP.pm  view on Meta::CPAN


If you have set the $Response->{ContentType}
to something other than text/html, cgi header parsing (see CGI
notes), will be automatically be turned off, so you will not
necessarily need to use BinaryWrite for writing binary data.

For an example of BinaryWrite, see the binary_write.htm example 
in ./site/eg/binary_write.htm

Please note that if you are on Win32, you will need to 
call binmode on a file handle before reading, if 
its data is binary.

=item $Response->Clear()

Erases buffered ASP output.

=item $Response->Cookies($name, [$key,] $value)

Sets the key or attribute of cookie with name $name to the value $value.
If $key is not defined, the Value of the cookie is set.

ASP.pm  view on Meta::CPAN


 - fixed bug in $Server->URL when called like $Server->URL($url)
   without parameters.  Its not clear which perl versions this bug 
   affected.

=item $VERSION = 2.55; $DATE="08/09/2003"

 - Bug fixes for running on standalone CGI mode on Win32 submitted
   by Francesco Pasqualini

 + Added Apache::ASP::Request::BINMODE for binmode() being
   called on STDIN after STDIN is tied to $Request object

 + New RequestBinaryRead configuration created, may be turned off
   to prevent $Request object from reading POST data

 ++ mod_perl 2 optmizations, there was a large code impact on this,
   as much code was restructured to reduce the differences between
   mod_perl 1 and mod_perl 2, most importantly, Apache::compat is
   no longer used

ASP.pm  view on Meta::CPAN

  in a new SESSIONS section.  Also documented new 
  FileUpload configs and $Request->FileUpload collection.
  Documented StatScripts.

 +StatScripts setting which if set to 0 will not reload
  includes, global.asa, or scripts when changed.

 +FileUpload file handles cleanup at garbage collection
  time so developer does not have to worry about lazy coding
  and undeffing filehandles used in code.  Also set 
  uploaded filehandles to binmode automatically on Win32 
  platforms, saving the developer yet more typing.

 +FileUploadTemp setting, default 0, if set will leave
  a temp file on disk during the request, which may be 
  helpful for processing by other programs, but is also
  a security risk in that others could potentially read 
  this file while the script is running. 

  The path to the temp file will be available at
  $Request->{FileUpload}{$form_field}{TempFile}.

README  view on Meta::CPAN

        the header if has not already been written.

        If you have set the $Response->{ContentType} to something other than
        text/html, cgi header parsing (see CGI notes), will be automatically be
        turned off, so you will not necessarily need to use BinaryWrite for
        writing binary data.

        For an example of BinaryWrite, see the binary_write.htm example in
        ./site/eg/binary_write.htm

        Please note that if you are on Win32, you will need to call binmode on a
        file handle before reading, if its data is binary.

    $Response->Clear()
        Erases buffered ASP output.

    $Response->Cookies($name, [$key,] $value)
        Sets the key or attribute of cookie with name $name to the value $value.
        If $key is not defined, the Value of the cookie is set. ASP CookiePath
        is assumed to be / in these examples.

README  view on Meta::CPAN

           when we were returning 200 ( HTTP_OK ) before

         - fixed bug in $Server->URL when called like $Server->URL($url)
           without parameters.  Its not clear which perl versions this bug 
           affected.

    $VERSION = 2.55; $DATE="08/09/2003"
         - Bug fixes for running on standalone CGI mode on Win32 submitted
           by Francesco Pasqualini

         + Added Apache::ASP::Request::BINMODE for binmode() being
           called on STDIN after STDIN is tied to $Request object

         + New RequestBinaryRead configuration created, may be turned off
           to prevent $Request object from reading POST data

         ++ mod_perl 2 optmizations, there was a large code impact on this,
           as much code was restructured to reduce the differences between
           mod_perl 1 and mod_perl 2, most importantly, Apache::compat is
           no longer used

README  view on Meta::CPAN

          in a new SESSIONS section.  Also documented new 
          FileUpload configs and $Request->FileUpload collection.
          Documented StatScripts.

         +StatScripts setting which if set to 0 will not reload
          includes, global.asa, or scripts when changed.

         +FileUpload file handles cleanup at garbage collection
          time so developer does not have to worry about lazy coding
          and undeffing filehandles used in code.  Also set 
          uploaded filehandles to binmode automatically on Win32 
          platforms, saving the developer yet more typing.

         +FileUploadTemp setting, default 0, if set will leave
          a temp file on disk during the request, which may be 
          helpful for processing by other programs, but is also
          a security risk in that others could potentially read 
          this file while the script is running. 

          The path to the temp file will be available at
          $Request->{FileUpload}{$form_field}{TempFile}.

lib/Apache/ASP/CGI.pm  view on Meta::CPAN

    defined($self->dir_config->get('NoState')) || $self->dir_config->set('NoState', 1);

    $self->method($ENV{REQUEST_METHOD} || 'GET');

    for my $env_key ( keys %ENV ) {
	$self->env($env_key, $ENV{$env_key});
    }
    $self->env('SCRIPT_NAME') || $self->env('SCRIPT_NAME', $filename);

    # fix truncated output in standalone CGI mode under Win32
    binmode(STDOUT);

    bless $self, $class;
}

sub init_dir_config {
    my($self, %config) = @_;
    my $dir_config = $self->dir_config;
    %$dir_config = %config;
    $dir_config;
}

lib/Apache/ASP/Request.pm  view on Meta::CPAN

					  );

		my %form;
		my $q = $self->{cgi} = new CGI;
		$asp->Debug($q->param);
		for(my @names = $q->param) {
		    my @params = $q->param($_);
		    $form{$_} = @params > 1 ? [ @params ] : $params[0];
		    if(ref($form{$_}) eq 'Fh') {
			my $fh = $form{$_};
			binmode $fh if $asp->{win32};
			$upload{$_} = $q->uploadInfo($fh);
			if($asp->{file_upload_temp}) {
			    $upload{$_}{TempFile} = $q->tmpFileName($fh);
			    $upload{$_}{TempFile} =~ s|^/+|/|;
			}
			$upload{$_}{BrowserFile} = "$fh";
			$upload{$_}{FileHandle} = $fh;
			$upload{$_}{ContentType} = $upload{$_}{'Content-Type'};
			# tie the file upload reference to a collection... %upload
			# may be many file uploads note.

site/changes.html  view on Meta::CPAN

   affected.
</pre></font>
	
	<p>
	<a name=%24VERSION%20%3D%202d9674a90></a>
	<font face=verdana><font class=title size=+0 color=#555555><b>$VERSION = 2.55; $DATE="08/09/2003"</b></font>
<font face="courier new" size=3><pre>
 - Bug fixes for running on standalone CGI mode on Win32 submitted
   by Francesco Pasqualini

 + Added Apache::ASP::Request::BINMODE for binmode() being
   called on STDIN after STDIN is tied to $Request object

 + New RequestBinaryRead configuration created, may be turned off
   to prevent $Request object from reading POST data

 ++ mod_perl 2 optmizations, there was a large code impact on this,
   as much code was restructured to reduce the differences between
   mod_perl 1 and mod_perl 2, most importantly, Apache::compat is
   no longer used

site/changes.html  view on Meta::CPAN

  in a new SESSIONS section.  Also documented new 
  FileUpload configs and $Request-&gt;FileUpload collection.
  Documented StatScripts.

 +StatScripts setting which if set to 0 will not reload
  includes, global.asa, or scripts when changed.

 +FileUpload file handles cleanup at garbage collection
  time so developer does not have to worry about lazy coding
  and undeffing filehandles used in code.  Also set 
  uploaded filehandles to binmode automatically on Win32 
  platforms, saving the developer yet more typing.

 +FileUploadTemp setting, default 0, if set will leave
  a temp file on disk during the request, which may be 
  helpful for processing by other programs, but is also
  a security risk in that others could potentially read 
  this file while the script is running. 

  The path to the temp file will be available at
  $Request-&gt;{FileUpload}{$form_field}{TempFile}.

site/eg/binary_write.htm  view on Meta::CPAN

#!/usr/bin/perl /usr/bin/asp-perl

<%
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->Clear;
    $Response->AddHeader('Content-Length', length $data);
    $Response->BinaryWrite($data);
    $Response->End;
} else {
%>

<!--#include file=header.inc-->

site/eg/binary_write.htm  view on Meta::CPAN

 We are going to load a gif through this
 same script as an example of doing a $Response->BinaryWrite()...

 <p>
 
 <img src="<%=basename($0)%>?type=gif">

 <p>

 Please note that if you are on Win32, you will need to 
 call binmode on a file handle before reading, if 
 its data is binary.

<!--#include file=footer.inc-->

<% } %>


site/objects.html  view on Meta::CPAN

<font face="courier new" size=3><pre>
</pre></font>If you have set the $Response-&gt;{ContentType}
to something other than text/html, cgi header parsing (see <a href=cgi.html><font size=-1 face=verdana><b>CGI</b></font></a>
notes), will be automatically be turned off, so you will not
necessarily need to use BinaryWrite for writing binary data.
<font face="courier new" size=3><pre>
</pre></font>For an example of BinaryWrite, see the binary_write.htm example 
in <a href=eg/binary_write.htm>./site/eg/binary_write.htm</a>
<font face="courier new" size=3><pre>
</pre></font>Please note that if you are on Win32, you will need to 
call binmode on a file handle before reading, if 
its data is binary.</font>
	
	<p>
	<a name=%24Response-%3EC08958c05></a>
	<font face=verdana><font class=title size=-1 color=#555555><b>$Response->Clear()</b></font>
<font face="courier new" size=3><pre>
</pre></font>Erases buffered ASP output.</font>
	
	<p>
	<a name=%24Response-%3ECd77d06d7></a>



( run in 0.283 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )