8 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/perl
# ==============================================
# Program : view_doc.pl - Opens documents from server and returns back to browser
#
# Created : 23.01.2004
# ==============================================
# == MODULES ==============================================
#use strict;
use warnings;
use CGI::Carp qw(fatalsToBrowser);
use CGI qw/:standard/;
# =//============================================
# == GLOBAL VARS DECLARATION =====================
my $query = new CGI;
my $id = $query->param(id);
my $datei = $query->param(source);
my $speed = 5*1024; # 5kb pro Sek.
my $mimetype =();
# =//============================================
# == PROGRAM CODE ==============================================
if ($id == "1"){
$mimetype = "Content-Type: application/pdf\n\n";
}
if ($id == "2"){
$mimetype = "Content-Type: text/xml\n\n";
}
print $mimetype;
open(FILE,"<".$datei) || die $!;
binmode(FILE);
binmode(STDOUT);
my $buffer;
while (read(FILE,$buffer,$speed)) {
print STDOUT $buffer;
sleep(1);
}
close (FILE);
# =//============================================
8 Einträge, 1 Seite |