<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Hosting API using HandleHttpRequest in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Hosting-API-using-HandleHttpRequest/m-p/396714#M249492</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I host an API using HandleHttpRequest which can be used to upload files to NiFi server from local using&amp;nbsp;"multipart/form-data".&lt;/P&gt;&lt;P&gt;Have tried below approach, however I get read permission issue as the Nifi user can't access local data.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-11-01 at 10.11.06 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/42431i451A461872152A99/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-11-01 at 10.11.06 PM.png" alt="Screenshot 2024-11-01 at 10.11.06 PM.png" /&gt;&lt;/span&gt; &lt;/P&gt;&lt;P&gt;Please suggest an approach which can be used to upload file from local.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Nov 2024 16:43:34 GMT</pubDate>
    <dc:creator>nifier</dc:creator>
    <dc:date>2024-11-01T16:43:34Z</dc:date>
    <item>
      <title>Hosting API using HandleHttpRequest</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hosting-API-using-HandleHttpRequest/m-p/396714#M249492</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I host an API using HandleHttpRequest which can be used to upload files to NiFi server from local using&amp;nbsp;"multipart/form-data".&lt;/P&gt;&lt;P&gt;Have tried below approach, however I get read permission issue as the Nifi user can't access local data.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-11-01 at 10.11.06 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/42431i451A461872152A99/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-11-01 at 10.11.06 PM.png" alt="Screenshot 2024-11-01 at 10.11.06 PM.png" /&gt;&lt;/span&gt; &lt;/P&gt;&lt;P&gt;Please suggest an approach which can be used to upload file from local.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2024 16:43:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hosting-API-using-HandleHttpRequest/m-p/396714#M249492</guid>
      <dc:creator>nifier</dc:creator>
      <dc:date>2024-11-01T16:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: Hosting API using HandleHttpRequest</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hosting-API-using-HandleHttpRequest/m-p/396723#M249495</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/117603"&gt;@nifier&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am not very clear on yoru use case.&lt;BR /&gt;&lt;BR /&gt;From your dataflow it appears some external source is making a rest-api call to the endpoint created by the HandleHTTPRequest processor.&amp;nbsp; The FlowFile produced by the HandleHTTPRequest processor contains necessary information to identify which file needs to be fetched from the local NiFi host's filesystem.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;What other info are you exposing through your rest-api request to the HandleHTTPRequest processor?&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The FetchFile processor is the one producing the read permission exception, correct?&lt;BR /&gt;&lt;BR /&gt;All components added to the NiFi canvas execute as the NiFi service user.&amp;nbsp; This means the NiFi service user needs to be authorized to read on the local files in order to ingest them.&lt;BR /&gt;&lt;BR /&gt;The local filesystem NiFi processor components do not provide an option to execute as another user.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Also your use case feels a bit dangerous from a security standpoint.&amp;nbsp; You are exposing a rest-api endpoint multiple user could potentially reach to fetch files.&amp;nbsp; I see no protection build into your dataflow.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Please help our community thrive. If you found&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;any&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Accept as Solution&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;" on&amp;nbsp;&lt;STRONG&gt;one or more&lt;/STRONG&gt;&amp;nbsp;of them that helped.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;BR /&gt;Matt&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2024 20:36:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hosting-API-using-HandleHttpRequest/m-p/396723#M249495</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2024-11-01T20:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: Hosting API using HandleHttpRequest</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hosting-API-using-HandleHttpRequest/m-p/396726#M249496</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for you response.&lt;/P&gt;&lt;P&gt;Use case is basically to only upload file using API, and not to download.&lt;/P&gt;&lt;P&gt;&amp;nbsp;We have an UI which is used upload a file, On click of choose file we were planning to call our backend API which inturn calls NiFi HandleHTTPRequest API.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Authorization will part of UI and API.&lt;/P&gt;&lt;P&gt;Also, NiFi API will not be directly exposed externally.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-11-02 at 8.54.13 AM.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/42434iF5A334B72EDA967B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-11-02 at 8.54.13 AM.png" alt="Screenshot 2024-11-02 at 8.54.13 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since we were exploring our options in Nifi, we are trying this approach.&lt;/P&gt;&lt;P&gt;If you feel this is not achievable or not the right approach, we can drop this and look into other options.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Sat, 02 Nov 2024 08:48:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hosting-API-using-HandleHttpRequest/m-p/396726#M249496</guid>
      <dc:creator>nifier</dc:creator>
      <dc:date>2024-11-02T08:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: Hosting API using HandleHttpRequest</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hosting-API-using-HandleHttpRequest/m-p/396751#M249506</link>
      <description>&lt;P&gt;I've done something similar where I use a custom Groovy processor to handle the file uploaded and posted to the HandleHTTPRequest does something with the data and provides a JSON response to HandleHTTPResponse&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="joseomjr_0-1730591947548.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/42444iEEB857866A1FD157/image-size/medium?v=v2&amp;amp;px=400" role="button" title="joseomjr_0-1730591947548.png" alt="joseomjr_0-1730591947548.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Nov 2024 23:59:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hosting-API-using-HandleHttpRequest/m-p/396751#M249506</guid>
      <dc:creator>joseomjr</dc:creator>
      <dc:date>2024-11-02T23:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Hosting API using HandleHttpRequest</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hosting-API-using-HandleHttpRequest/m-p/396889#M249624</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/105558"&gt;@joseomjr&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;So you are reading the file from local using&amp;nbsp;&lt;SPAN&gt;Groovy processor which is invoked&amp;nbsp; in InvokeScriptedProcessor ??&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 08:21:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hosting-API-using-HandleHttpRequest/m-p/396889#M249624</guid>
      <dc:creator>nifier</dc:creator>
      <dc:date>2024-11-04T08:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: Hosting API using HandleHttpRequest</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hosting-API-using-HandleHttpRequest/m-p/396967#M249668</link>
      <description>&lt;P&gt;The Groovy processor takes the incoming FlowFile and does stuff with it and writes a new FlowFile with the repsonse. What I tried was a JSON upload but will try "multipart/form-data" if I get a chance and see how that looks.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 02:55:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hosting-API-using-HandleHttpRequest/m-p/396967#M249668</guid>
      <dc:creator>joseomjr</dc:creator>
      <dc:date>2024-11-05T02:55:29Z</dc:date>
    </item>
  </channel>
</rss>

