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
|
on *:SOCKLISTEN:dir:{ sockaccept dir $+ $ticks }
on *:SOCKREAD:dir*:{
var %x
sockread %x
echo -a %x
tokenize 32 %x
if (GET /* iswm $1-) {
sockwrite -n $sockname <center>
if ($2 == /) {
var %x = 1
while (%x <= $disk(0)) {
sockwrite -n $sockname <a href="/ $+ $disk(%x).path $+ "> $+ $disk(%x).path $+ </a><br>
inc %x
}
}
elseif (GET /*:%5C HTTP/?.? iswm $1-) {
noop $findfile($replace($right($2,-1),% $+ 5C,\),*,0,0,sockwrite -n $sockname <a href="/ $+ $1- $+ "> $+ $1- $+ </a> ( $+ $bytes($file($1-).size).suf $+ )<br>)
}
elseif (GET /*:%5*.* HTTP/?.? iswm $1-) {
var %x = 1
while (%x <= $lines($replace($right($2,-1),% $+ 5C,\))) {
sockwrite -n $sockname $read($replace($right($2,-1),% $+ 5C,\),%x) $+ <br>
inc %x
}
}
}
sockwrite -n $sockname </center>
sockclose $sockname
}
|