cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2341
Views
0
Helpful
1
Replies

Uploading files to a another server using "File Upload" input

NMagnano1
Level 1
Level 1

Hi everyone, 

I created a Workflow to upload a file using  "File Upload" input. It works, and I have my uploaded file on my ucsdirector server, on the path:   /opt/infra/uploads/myuser/tempfolder/file.ext

 

Now, using ssh and scp, I need to transfer that file from my ucsdirectorserver to another server.

How can I do? I already have the file path as a generic input text. But I have no idea how to transfer the file. 

 

I tried connecting from destination server to ucsdirector server, but it seems to not be correct.

 

scp shelladmin@UCSD_SERVER:/opt/infra/uploads/myuser/tempfolder/file.ext /home/user/test/file.ext

 

Thanks everyone!

Cheers

1 Reply 1

mpetra
Cisco Employee
Cisco Employee

Files uploaded are saved in a folder named as the base64 encoded file name.

ex: /opt/infra/uploads/multipart/<base64 of file name>/filename

The only other important information is the file is temporary. It will be removed once the workflow completes.

 

This is an example script that I use to output for use:

importPackage(java.util);
importPackage(java.lang);
importPackage(java.io);
importPackage(com.cloupia.lib.util);
importPackage(com.cloupia.model.cIM);
importPackage(com.cloupia.service.cIM.inframgr);
importPackage(com.cloupia.lib.util.Base64Coder);

var File = input.FileUpload;
var buildParameters = [];
var inputNames = [];

//Get File Path
var encoded = Base64Coder.encodeString(File);
var path = '/opt/infra/uploads/multipart/' + encoded+'/' + File;
logger.addInfo('Path: ' + path);

output.Path = path;

Cisco UCS X-Series Energy Efficiency Offer