Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 
Community Member

How to upload a file to FTP using CPO?

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.



Everyone's tags (2)
Cisco Employee

How to upload a file to FTP using CPO?

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 Roberts

Technical Leader, Services

Community Member

How to upload a file to FTP using CPO?

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,


Cisco Employee

How to upload a file to FTP using CPO?


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

:: 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

ECHO Usage: %0 username password folder file server


Then call it like


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 Roberts

Technical Leader, Services

CreatePlease to create content