[thelist] Simple form based ftp

Burhan Khalid thelist at meidomus.com
Wed Nov 24 06:58:02 CST 2004


Karen Longstaff wrote:
> I need to be able to ftp a file to a server which is an sql server rather
> than the web server that is hosting the page. I have FTP access to the SQL
> server.
> 
> I want the user to be able to use a form to browse to a file (that bit I can
> do!) and then on submit the file should be FTP'd to the sql server. I have:
> the server IP, the directory structure I want to FTP to, the user name and
> the password.
> 
> Is there a simple script (I'm not a techie) that I can use to do the FTP?

Since you mentioned ASP, I can only offer this:

This is probably not the best solution, but you could fork a process and 
run the built-in ftp command in Windows, the task becomes very simple.

The windows FTP command can take a plain text file with FTP commands as 
an argument so that the process is pretty much automated. Say you wanted 
to automate the transfer of a file (C:\myfile.txt) to ftp.myserver.com, 
where you want to login with my_user and my_secret as your password. 
This sequence of commands would do it:

open ftp.myserver.com
my_user
my_pass
lcd C:\
put myfile.txt
quit

If you save this as c:\ftp.txt, then you can run this :

ftp -s:C:\ftp.txt

Maybe this helps?



More information about the thelist mailing list