on 07-13-2008 4:07 PM
Hello all,
I have to write an Interface the creates a file in a FTP server with user + password.
after the file had been created I have to move it to a different folder in the same server.
my problem is: do I have to give the user and password again where i write the OS command?
Thanks,
Naama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks to all of you,
i found the solition if anyone is intrested
I created a regular bat file - not ftp one, and send to it parameters using %,
and that bat file created another one but now an FTP one
echo user username > Input_file
echo passward >> Input_file
echo rename XI_temp/%1 XI/%1 >> Input_file
echo bye >> Input_file
ftp -n -s:Input_file hostname
Hi
your question is : *Can i use the dynamic path/file name in the script? using the %f, %F parameters *
Yes you can dynamically set your name in the script using the % % parameters.
Below i have written the code.
In your receiver communication channel in the processing tab->Run operating system command after message processing, there you have to write a batch program.
for eg :
======================
open 10.4.71.145
mmdftp =========== username
Eimskip123======== password
cd /TestSource
get TestData1.xml
cd /TestTarget
put TestData1.xml
ren Testdata.xml %TestData1%.xml
quit
Batch File Content (File_Copy_Batch.bat)
=====================
This link will help you out
Hope this answers your question
Thanks
Saiyog
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks for your help,
but its still not working' I don't manage to transfer parameters to the batch file'
I try to do this also not threw the XI, but threw the cmd window and its not working,
maybe in a ftp command the script cant get parameters?
my script looks like this:
open 156.12.7.9
username
passward
rename XI\%1 XI_temp\%1
bye
and I try to run it by: ftp -s:
sapdx1\xifiles\com.bat %f
Thanks,
Naama
Hi,
Thanks,
My problem is not variable substitution, its transferring parameters to bat file.
from my previous experience i know the in ftp server there is a chance that when i am creating a file,
the other system that reads the file can read it before i finish writing,
so i want to write the file to temp dir and then move it using an OS command
Thanks,
naama
Hi Naama,
I am not sure how variables are passed to batch files. I have worked with shell script files for dealing with almost similar requirements. I have passed the file name using %f and %F using receiver communication channel. The command looked some thing like this
sh /home/scriptdir/MERGE.sh %f
With in script we use $1 for getting the parameter passed as an arguement.
Regards,
Jaishankar
Thanks for your answer,
I have another question,
can i use the dynamic path/file name in the script? using the %f, %F parameters?
Thanks a lot,
Naama.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
You can try this - don't know wether it works. take two adapter specific parameters ( var1 , var2 ) and set values to those values dynamically in message mapping . Use these two adapter specific parameters and configure the file communication channel with the OS command .
OS command you can set - ex : movefile.bat Var1 Var2
Pls try this and let us know.
Regards,
Kishore
Hi,
>>my problem is: do I have to give the user and password again where i write the OS command?
Usually srcipt files are used when the target location is XI server file path. Coz the script file that needs to be invoked should be placed in XI server file path. If you need to use script file for handling files in a FTP server, then you should login to the FTP server from the script files using FTP commands. So you need to use the user name and password with in the script file.
Regards,
Jaishankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you need not have to give the user and password again where you write the OS command in batch file(bat file).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.