FTP Get and Put file operation with ini File

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
asheffer
Newbie
Posts: 18
Joined: Mon Jul 21, 2003 7:57 pm

FTP Get and Put file operation with ini File

Post by asheffer » Mon Jul 21, 2003 8:00 pm

Can I use a ini file to designate the peramiters for the ftpgetfile and the ftpputfile operations.
Al Sheffer

Lumumba

Post by Lumumba » Tue Jul 22, 2003 6:25 am

I guess, YES!
The values of each key could be used as variables. No problem.

asheffer
Newbie
Posts: 18
Joined: Mon Jul 21, 2003 7:57 pm

FTP Get and Put file operation with ini File

Post by asheffer » Tue Jul 22, 2003 1:07 pm

I thought you could but I just cant seem to get the syntax write.

Thanks
Al Sheffer

Lumumba

Post by Lumumba » Tue Jul 22, 2003 2:32 pm

The below line is stolen from MScheds onlinehelp,

Code: Select all

FTPPutFile>ftp.domain.com,anonymous,[email protected],21,c:\temp\readme.txt,/pub/readme.txt,A
So your code would look like this:

Code: Select all


Let>File=readme.txt
Let>inifile=C:\Temp\Upload.ini
Let>section=Upload

ReadIniFile>inifile,section,Server,Server
ReadIniFile>inifile,section,Username,Username
ReadIniFile>inifile,section,Password,Password
ReadIniFile>inifile,section,Port,Port
ReadIniFile>inifile,section,Local,Local
ReadIniFile>inifile,section,Host,Host
ReadIniFile>inifile,section,Mode,Mode

Label>CheckForFile
Change Directory>%Local%
IfFileExist>%File%,Upload
Wait>3
Goto>CheckForFile

Label>Upload
ConCat>Local,%File%
ConCat>Host,%File%
FTPPutFile>Server,Username,Password,port,Local,Host,Mode

And the assigned INIFile Upload.ini should contain this:

[Upload]
Server=ftp.domain.com
Username=anonymous
Password=[email protected]
Port=21
Local=c:\temp\
Host=/pub/
Mode=A

BTW: It's nearly the same with GET :wink:

asheffer
Newbie
Posts: 18
Joined: Mon Jul 21, 2003 7:57 pm

FTP Get and Put file operation with ini File

Post by asheffer » Tue Jul 22, 2003 6:57 pm

Thank you for the info

Everything worked except I cant get the file to post to a subdirectory it only posts the file to the root folder. I have checked the name and it is right. The local is working fine the Host is not.
Do you have any ideas?

Thanks
Al Sheffer

Lumumba

Post by Lumumba » Tue Jul 22, 2003 8:31 pm

Have a try with doing it manualy to check if it's necessary to have a leading slash in the path. It's possible that the filesystem is configured differently, based on the OS which is used on the Server (I assume in the sample it's a UNIX Box (slash not backslash)).

If it's not that easy send a mail to MSched support.

Lumumba

Post by Lumumba » Tue Jul 22, 2003 8:42 pm

If you can't solve this issue with MScheds FTP commands, search for the keyword FTP in this forum.

You'll find the option to use the generic FTP command which is part of your OS.

asheffer
Newbie
Posts: 18
Joined: Mon Jul 21, 2003 7:57 pm

Post by asheffer » Fri Aug 08, 2003 7:05 pm

Thanks for all the help I got it working. It was a issue with the firwall

Thanks
Al Sheffer

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts