Name

pkit_send — Can be used to send data to the client.

Synopsis


        #
        # for a filename, the media_type will be found by the MIME::Types module.
        #
	my $status_code = $model->pkit_send($filename);

        my $status_code = $model->pkit_send(\$data, 'image/png');

        # $data_ref is not zipped by the pkit_send methode, it sends
        # it only with this encoding header.
	my $status_code = $model->pkit_send($data_ref, 'html/text', 'gzip');

        my $status_code = $model->pkit_send($fh);

        $model->pkit_status_code($status_code);

     

Description

Can be used to send data to the client. From a scalar_ref a filename or a reference to a filehandle. If the first argument is a filename, and the second argument media_type is not set, the module MIME::Types try to find the media_type for us depending on the suffix. If this fails or the optional second argument media_type is not set, the default application/octet-stream is used. If the request was only a head request, only a header is send back to the client. The optional third argument if the content_encoding (ie: gzip|x-gzip|compress|x-compress) it is only used if the media_type is html/text.