cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
832
Views
0
Helpful
3
Replies

How to upload a file to FTP using CPO?

msivarami3
Level 1
Level 1

Hi All,

Do you have any idea how to upload a file to FTP that is created using write file activity in CPO.We are able to save the file in the local path of the server.

Thanks,

Ram

3 Replies 3

Shaun Roberts
Cisco Employee
Cisco Employee

I would suggest you use command line FTP. I know some of done it like that. You could use the PUT file activity if using SFTP on a unix box, but for windows box, I would say command line FTP is your best bet.

-shaun

--Shaun Roberts
Principal Engineer, CX
shaurobe@cisco.com

Hi Shaun,

I tried the same thing as you said. We have created a batch file with the FTP commands and tried to execute the batch file using the Execute Windows Command activity. But the the windows command state says running for so much time but not getting to succees state.

Is the approach correct or there is any other activity to run the batch file?

Thanks & Regards,

Atchut.

Hi,

Works fine for me. Here is the batch script I wrote up...

@ECHO OFF
:: Check if the password was given
IF "%2"=="" GOTO Syntax
:: Create the temporary script file
> script.ftp ECHO %1
>>script.ftp ECHO %2
>>script.ftp ECHO cd %3
>>script.ftp ECHO binary
>>script.ftp ECHO prompt n
>>script.ftp ECHO put %4
>>script.ftp ECHO quit
:: Use the temporary script for unattended FTP
:: Note: depending on your OS version you may have to add a '-n' switch
FTP -s:script.ftp %5
:: For the paranoid: overwrite the temporary file before deleting it
TYPE NUL >script.ftp
DEL script.ftp
GOTO End

:Syntax
ECHO Usage: %0 username password folder file server

:End

Then call it like

ftpBatch.bat

This is of course to move a file from your server to an FTP. I wrote the script and the process and got it working in like 15 minutes, so should not be too bad. The script is very basic though and for production level you'd probably want something more robust.


If you need help and have a services contract, you can open a TAC case if you are seeing a specific issue.

If this script does not work for you, there are plenty of batch based FTP file scripts out there to build on.

-shaun

--Shaun Roberts
Principal Engineer, CX
shaurobe@cisco.com
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: