2011-11-28 15:24:38 +00:00
|
|
|
#!/mod/bin/jimsh
|
|
|
|
|
|
|
|
package require cgi
|
2012-05-21 20:23:41 +00:00
|
|
|
#source /mod/webif/lib/setup
|
2011-11-28 15:24:38 +00:00
|
|
|
|
|
|
|
puts "Content-Type: text/html\r\n\r\n"
|
|
|
|
|
|
|
|
cgi_input
|
|
|
|
#cgi_dump
|
|
|
|
|
|
|
|
set expected [cgi_get esize 1]
|
|
|
|
set file [file normalize [cgi_get file]]
|
|
|
|
|
|
|
|
if {![file exists $file]} {
|
|
|
|
puts "0"
|
|
|
|
} else {
|
|
|
|
set sz [file size $file]
|
|
|
|
|
|
|
|
set perc [expr $sz * 100 / $expected]
|
|
|
|
if {$perc > 100} { set perc 100 }
|
|
|
|
puts $perc
|
|
|
|
}
|
|
|
|
|