It is a practical matter for me, that when I use FTP programmatically, that
I frequently to multiple uploads.
To that end, I have made the following changes to the ftp module,
Code: Select all
(define (transfer user-id password host subdir file-names mode)
  (if (string? file-names)(set 'file-names(list file-names))) and the following change to the 'PUT option:
Code: Select all
(if (= mode PUT)
        (and
		 (dolist (file-name file-names)
				 (println "<BR>file-name = "  file-name) ;; DEBUG file-name
				 (check-file file-name)
				 (net-send socket (append "STOR " file-name "\r\n"))
				 (send-get-result "STAT\r\n" "1")
				 (println "opening file")
				 (set 'fle (open file-name "r"))
				 (while (> (read-buffer fle 'buffer 512) 0)
						(if debug-mode (print "."))
						(net-send socket2 buffer 512))
				 (close fle)
				 (println "file closed")
				 )) true)
Code: Select all
  (set 'FTP:debug-mode true)
  (set 'res(FTP:put "*user*" "*pwd*" "www.johnsons-web.com" "/demo/newlisp"
					'("usr.lsp" "testcgi.dbg"))Code: Select all
file-names = ("usr.lsp" "testcgi.dbg")
sent:USER *user*
331 Please specify the password.
sent:PASS *pwd*
230 Login successful. Have fun.
sent:CWD /demo/newlisp
250 Directory successfully changed.
sent:TYPE I
200 Switching to Binary mode.
sent:PASV
227 Entering Passive Mode (12,24,138,43,204,222)
file-name = usr.lsp
sent:STAT
150 Ok to send data.
opening file
........file closed
file-name = testcgi.dbg
sent:STATsend and prior to the second call to 'open
:-) If we get this one working, I promise not to hack any more
of Lutz's code for at least a week or until I learn a bit more about
TCP/IP
Thanks
Tim