Support Questions

Find answers, ask questions, and share your expertise

Move file from http cloud serve to another servers directory

avatar

move a file from: 

EX - http://77.17.6.166/tls/file/nn.csv

to: hostname:77.17.6.122

    remote directory - /tls/file

and rename as hello.csv

 

guide me with processor an there respective configuration

 

1 ACCEPTED SOLUTION

avatar
Master Mentor

@nishank_paras 

 

You can use the invokeHTTP processor to fetch your file.  Here is an example:
Screen Shot 2020-02-25 at 2.15.36 PM.png

The above example fetches the Apache nifi-toolkit-1.11.3-bin.tar.gz file.

You can then construct a dataflow using other processors to manipulate as you want or simply just connect to another invokeHTTP processor that instead of "GET" uses "PUT" to put your file "nn.csv" at the new http endpoint.

 

Hope this helps you,

Matt

 

View solution in original post

5 REPLIES 5

avatar
Master Mentor

@nishank_paras 

 

First we need to asks questions to better understand the http cloud endpoint:

How do you currently accomplish this task outside of NiFi?
Is it possible to connect via a terminal/command prompt to get the file from the http cloud server?
Does the http cloud service have a rest-api for getting data from it?

 

My first thought would be the invokeHTTP processor to get your file from the http cloud server...
Then use an UpdateAttribute processor to change the "filename" attribute value on the NiFi FlowFile created by the invokeHTTTP processor...
 You did not mention what you want to do with this file once you have retrieved it ad renamed it in NiFi.  Are you trying to write it back to the same http cloud service?  Are you trying to write the file to another service/endpoint?  Are you writing it to a local directory?

 

Then we can start to look at what processors NiFi may have available to accomplish the same methods.

 

Hope this helps get you started,

Matt

avatar

@MattWho 

i am trying to save it to a remote server

 

yes this task can be done using shell scripting 

avatar
Master Mentor

@nishank_paras 

 

You can use the invokeHTTP processor to fetch your file.  Here is an example:
Screen Shot 2020-02-25 at 2.15.36 PM.png

The above example fetches the Apache nifi-toolkit-1.11.3-bin.tar.gz file.

You can then construct a dataflow using other processors to manipulate as you want or simply just connect to another invokeHTTP processor that instead of "GET" uses "PUT" to put your file "nn.csv" at the new http endpoint.

 

Hope this helps you,

Matt

 

avatar
Explorer

You may use below commands for this. 

 

wget http://77.17.6.166/tls/file/nn.csv

scp nn.csv username@77.17.6.122:/tls/file/hello.csv

avatar

this is shell scripting i need to do this in nifi

@Vj1989