Madalin Master

Joined: 24 Jun 2005 Posts: 310 Location: Constanta, Romania
|
Posted: Sat Jan 26, 2013 2:35 pm Post subject: sendftp for multitple files |
|
|
Can anyone tell me what is wrong with this code? When its tested to upload only 1 file it works ok but whene i make it do add multiple files it fails.
| Code: |
proc timed:upload {m h d m y} {
global ftp
set ftpx [open "|ftp -n $ftp(host)" w]
puts $ftpx "user $ftp(user) $ftp(pass)"
puts $ftpx "bin"
foreach file [lsort [glob -directory $ftp(dir) *]] {
if { [file readable $file] && [file isfile $file]} {
puts $ftpx "put $file ${ftp(updir)}${file}"
putlog "${ftp(updir)}${file}"
}
}
puts $ftpx "quit"
close $ftpx
putlog "FTP: all files in $ftp(dir) uploaded successfuly to $ftp(host)"
}
|
_________________ https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL |
|