Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
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.

Thanks,

Ram

Everyone's tags (2)
3 REPLIES
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

--Shaun Roberts

Technical Leader, Services

shaurobe@cisco.com

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,

Atchut.

Cisco Employee

How to upload a file to FTP using CPO?

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

Technical Leader, Services

shaurobe@cisco.com

266
Views
0
Helpful
3
Replies
CreatePlease to create content