Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

auomatic ftp

Status
Not open for further replies.

msturges

Programmer
Mar 29, 2001
32
0
0
ZA
Hi Guys,

I'm not sure whether or not this is the right forum for this question, but anyway. I need to automate an ftp session when a user logs on to a web page.

I created a ".bat" file which actions the ftp automatically. The only problem I have now is trying to invoke the actions of this ".bat" file from a web page.

I tried to include the file like this:
<!--#include file=&quot;scripts/FTP.bat&quot; -->

inside the FTP.bat file:
ftp -i -s:Fetch.txt

the &quot;Fetch.txt&quot; file specifies the IP address, username and password for the FTP session and holds the get command.

When I execute the FTP.bat file from the Windows explorer, the FTP is successfull, but, when I try and execute it from the web page, nothing happens.

Is it even possible to call a &quot;.bat&quot; file from a web page? If so, what is the trick? If not, is there another way I can do this??

thanks alot
Mike.
 
Mike,

What are you trying to do? Are you trying to upload a file to the web server or transfer a file to another FTP site?

Using an &quot;INCLUDE&quot; statement for the bat file does nothing for the web page since it can't understand what's in the bat file.

What you should do is gather the parameters such as the IP address, username, password, etc. Then pass it off to another ASP page to run a shell command that does the FTP.

fengshui_1998
 
Hi FengShui,

Yes I am trying to upload the file to the web server.

I realised that the INCLUDE statement didn't work, but I didn't know of any other way to do it.

When you say that I should pass the parameters to another ASP page that runs a shell script. Do you have an example of this that I can work with??

thanks alot
Mike.
 
Mike, look into WShell.script object (Windows Script Host). That's what you need to use. Fengshui1998 is our &quot;resident expert&quot; on this subject, so he (she?) will probably get back to you on this, but in the mean time, you might do your own searches to see what you can uncover.

Wish I knew the syntax, or I would give it to you.
penny.gif
penny.gif
 
thanks link 9,

i'll investigate it further in the mean time.
 
msturges, are you trying to upload a file from the client to the server via ftp and a batch file? I don't think that will work. You should look into a product like or write your own http upload control.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top