2011-11-28 15:24:38 +00:00
|
|
|
#!/mod/bin/jimsh
|
|
|
|
|
|
|
|
package require cgi
|
2013-02-09 22:46:15 +00:00
|
|
|
source /mod/webif/lib/setup
|
2011-11-28 15:24:38 +00:00
|
|
|
|
2013-02-09 22:46:15 +00:00
|
|
|
httpheader
|
2011-11-28 15:24:38 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|