Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

Data transfer via nifi api

avatar
Contributor

Hello,

 

how do I properly use the nifi-api to create flowfile from a file? I tried to do what is described here: https://nifi.apache.org/docs/nifi-docs/rest-api/index.html under 'Data transfer'

 

I've tried to use a simple curl command to transfer a file as flowfile to an input port as follows:

curl -X POST -F 'file=@Documents/Nifi_Docs/example.txt' http://10.0.1.111:8080/nifi-api/data-transfer/input-ports/dac743ae-0189-1000-c6a6-efd211a162d1/trans...

 

As response I get a 415 error Unsupported Media Type. What is the supported media type then? Anyone tried this before? What is the transaction id good for? I just put 1010 as a random number.

 

I also tried sending from postman

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Fredi 

NiFi's remote input ports are designed to receive NiFi FlowFiles transmitted to the remote-input port by a NiFi Remote Process Group (RPG) using NiFi's Site-to-Site (S2S) protocol.  They are not intended to be used for pushing arbitrary files into a NiFi dataflow.    

For moving files in to NiFi, you should be using a NiFi processor for that.  There a variety of different of different processors available to include but not limited to ListFile+FetchFile, ListSMB+fetchSMB, listSFTP+FetchSFTP, GetFile, HandleHTTPRequest+HandleHTTPResponse, ListenHTTP, etc.

If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.

Thank you,

Matt

View solution in original post

2 REPLIES 2

avatar
Master Mentor

@Fredi 

NiFi's remote input ports are designed to receive NiFi FlowFiles transmitted to the remote-input port by a NiFi Remote Process Group (RPG) using NiFi's Site-to-Site (S2S) protocol.  They are not intended to be used for pushing arbitrary files into a NiFi dataflow.    

For moving files in to NiFi, you should be using a NiFi processor for that.  There a variety of different of different processors available to include but not limited to ListFile+FetchFile, ListSMB+fetchSMB, listSFTP+FetchSFTP, GetFile, HandleHTTPRequest+HandleHTTPResponse, ListenHTTP, etc.

If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.

Thank you,

Matt

avatar
Contributor

Ok, thanks for the info. I thought it would have been an elegant solution to be able to use the nifi-api to transfer files directly to a port. I have tried ListenHTTP, which suits my task perfectly.