<?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 Re: How to upload a file to HDFS using Webhdfs rest api in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-upload-a-file-to-HDFS-using-Webhdfs-rest-api/m-p/201555#M68629</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14200/asirna.html" nodeid="14200"&gt;@Aditya Sirna&lt;/A&gt;, /tmp/testa dir is present. an livy user has permission to write to it. &lt;/P&gt;&lt;P&gt;I received below output while trying to run webhdfs rest api. &lt;/P&gt;&lt;PRE&gt;[root@xx user]# curl -i -X PUT "http://&amp;lt;namenode host&amp;gt;:50070/webhdfs/v1/tmp/testa/a.txt?user.name=livy&amp;amp;op=CREATE"
HTTP/1.1 307 TEMPORARY_REDIRECT
Cache-Control: no-cache
Expires: Tue, 26 Sep 2017 17:33:17 GMT
Date: Tue, 26 Sep 2017 17:33:17 GMT
Pragma: no-cache
Expires: Tue, 26 Sep 2017 17:33:17 GMT
Date: Tue, 26 Sep 2017 17:33:17 GMT
Pragma: no-cache
X-FRAME-OPTIONS: SAMEORIGIN
Set-Cookie: hadoop.auth="u=livy&amp;amp;p=livy&amp;amp;t=simple&amp;amp;e=1506483197716&amp;amp;s=dRvADKPG0lrenLje4fmEEdgChFw="; Path=/; HttpOnly
Location: &lt;A href="http://xxx:50075/webhdfs/v1/tmp/testa/a.txt?op=CREATE&amp;amp;user.name=livy&amp;amp;namenoderpcaddress=xxx:8020&amp;amp;createflag=&amp;amp;createparent=true&amp;amp;overwrite=false" target="_blank"&gt;http://xxx:50075/webhdfs/v1/tmp/testa/a.txt?op=CREATE&amp;amp;user.name=livy&amp;amp;namenoderpcaddress=xxx:8020&amp;amp;createflag=&amp;amp;createparent=true&amp;amp;overwrite=false&lt;/A&gt;
Content-Type: application/octet-stream
Content-Length: 0
Server: Jetty(6.1.26.hwx)
[root@xxx user]# curl -i -T /tmp/a.txt "http://&amp;lt;namenode host&amp;gt;:50070/webhdfs/v1/tmp/testa/a.txt?op=CREATE&amp;amp;overwrite=false"
HTTP/1.1 100 Continue
HTTP/1.1 307 TEMPORARY_REDIRECT
Cache-Control: no-cache
Expires: Tue, 26 Sep 2017 17:33:49 GMT
Date: Tue, 26 Sep 2017 17:33:49 GMT
Pragma: no-cache
Expires: Tue, 26 Sep 2017 17:33:49 GMT
Date: Tue, 26 Sep 2017 17:33:49 GMT
xRAME-OPTIONS: SAMEORIGIN

Location: &lt;A href="http://xxx:50075/webhdfs/v1/tmp/testa/a.txt?op=CREATE&amp;amp;namenoderpcaddress=xx:8020&amp;amp;createflag=&amp;amp;createparent=true&amp;amp;overwrite=false" target="_blank"&gt;http://xxx:50075/webhdfs/v1/tmp/testa/a.txt?op=CREATE&amp;amp;namenoderpcaddress=xx:8020&amp;amp;createflag=&amp;amp;createparent=true&amp;amp;overwrite=false&lt;/A&gt;
Content-Type: application/octet-stream
Content-Length: 0
Server: Jetty(6.1.26.hwx)
&lt;BR /&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 27 Sep 2017 01:37:39 GMT</pubDate>
    <dc:creator>yvora</dc:creator>
    <dc:date>2017-09-27T01:37:39Z</dc:date>
    <item>
      <title>How to upload a file to HDFS using Webhdfs rest api</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-upload-a-file-to-HDFS-using-Webhdfs-rest-api/m-p/201553#M68627</link>
      <description>&lt;P&gt;I'm looking for Wehdfs Rest api example to upload a file to HDFS.  I tried with below Api but could not upload a file to hdfs&lt;/P&gt;&lt;P&gt;curl -i -X PUT "http://&amp;lt;namenode host&amp;gt;:50070/webhdfs/v1/tmp/testa/a.txt?user.name=livy&amp;amp;op=CREATE"&lt;/P&gt;&lt;P&gt;curl -i -T /tmp/a.txt "http://&amp;lt;namenode host&amp;gt;:50070/webhdfs/v1/tmp/testa/a.txt?op=CREATE&amp;amp;overwrite=false"&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 00:50:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-upload-a-file-to-HDFS-using-Webhdfs-rest-api/m-p/201553#M68627</guid>
      <dc:creator>yvora</dc:creator>
      <dc:date>2017-09-27T00:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to upload a file to HDFS using Webhdfs rest api</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-upload-a-file-to-HDFS-using-Webhdfs-rest-api/m-p/201554#M68628</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/551/yvora.html" nodeid="551"&gt;@yvora&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The above API looks fine. Is the API returning 201 or any other status code. Did you make sure that /tmp/testa path exists and livy has write permission on it.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Aditya&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 01:26:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-upload-a-file-to-HDFS-using-Webhdfs-rest-api/m-p/201554#M68628</guid>
      <dc:creator>asirna</dc:creator>
      <dc:date>2017-09-27T01:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to upload a file to HDFS using Webhdfs rest api</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-upload-a-file-to-HDFS-using-Webhdfs-rest-api/m-p/201555#M68629</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14200/asirna.html" nodeid="14200"&gt;@Aditya Sirna&lt;/A&gt;, /tmp/testa dir is present. an livy user has permission to write to it. &lt;/P&gt;&lt;P&gt;I received below output while trying to run webhdfs rest api. &lt;/P&gt;&lt;PRE&gt;[root@xx user]# curl -i -X PUT "http://&amp;lt;namenode host&amp;gt;:50070/webhdfs/v1/tmp/testa/a.txt?user.name=livy&amp;amp;op=CREATE"
HTTP/1.1 307 TEMPORARY_REDIRECT
Cache-Control: no-cache
Expires: Tue, 26 Sep 2017 17:33:17 GMT
Date: Tue, 26 Sep 2017 17:33:17 GMT
Pragma: no-cache
Expires: Tue, 26 Sep 2017 17:33:17 GMT
Date: Tue, 26 Sep 2017 17:33:17 GMT
Pragma: no-cache
X-FRAME-OPTIONS: SAMEORIGIN
Set-Cookie: hadoop.auth="u=livy&amp;amp;p=livy&amp;amp;t=simple&amp;amp;e=1506483197716&amp;amp;s=dRvADKPG0lrenLje4fmEEdgChFw="; Path=/; HttpOnly
Location: &lt;A href="http://xxx:50075/webhdfs/v1/tmp/testa/a.txt?op=CREATE&amp;amp;user.name=livy&amp;amp;namenoderpcaddress=xxx:8020&amp;amp;createflag=&amp;amp;createparent=true&amp;amp;overwrite=false" target="_blank"&gt;http://xxx:50075/webhdfs/v1/tmp/testa/a.txt?op=CREATE&amp;amp;user.name=livy&amp;amp;namenoderpcaddress=xxx:8020&amp;amp;createflag=&amp;amp;createparent=true&amp;amp;overwrite=false&lt;/A&gt;
Content-Type: application/octet-stream
Content-Length: 0
Server: Jetty(6.1.26.hwx)
[root@xxx user]# curl -i -T /tmp/a.txt "http://&amp;lt;namenode host&amp;gt;:50070/webhdfs/v1/tmp/testa/a.txt?op=CREATE&amp;amp;overwrite=false"
HTTP/1.1 100 Continue
HTTP/1.1 307 TEMPORARY_REDIRECT
Cache-Control: no-cache
Expires: Tue, 26 Sep 2017 17:33:49 GMT
Date: Tue, 26 Sep 2017 17:33:49 GMT
Pragma: no-cache
Expires: Tue, 26 Sep 2017 17:33:49 GMT
Date: Tue, 26 Sep 2017 17:33:49 GMT
xRAME-OPTIONS: SAMEORIGIN

Location: &lt;A href="http://xxx:50075/webhdfs/v1/tmp/testa/a.txt?op=CREATE&amp;amp;namenoderpcaddress=xx:8020&amp;amp;createflag=&amp;amp;createparent=true&amp;amp;overwrite=false" target="_blank"&gt;http://xxx:50075/webhdfs/v1/tmp/testa/a.txt?op=CREATE&amp;amp;namenoderpcaddress=xx:8020&amp;amp;createflag=&amp;amp;createparent=true&amp;amp;overwrite=false&lt;/A&gt;
Content-Type: application/octet-stream
Content-Length: 0
Server: Jetty(6.1.26.hwx)
&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Sep 2017 01:37:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-upload-a-file-to-HDFS-using-Webhdfs-rest-api/m-p/201555#M68629</guid>
      <dc:creator>yvora</dc:creator>
      <dc:date>2017-09-27T01:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to upload a file to HDFS using Webhdfs rest api</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-upload-a-file-to-HDFS-using-Webhdfs-rest-api/m-p/201556#M68630</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/551/yvora.html" nodeid="551"&gt;@yvora&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Make the 2nd curl call to the Location which was returned in the first call.&lt;/P&gt;&lt;P&gt;ie., &lt;A href="http://xxx:50075/webhdfs/v1/tmp/testa/a.txt?op=CREATE&amp;amp;user.name=livy&amp;amp;namenoderpcaddress=xxx:8020&amp;amp;createflag=&amp;amp;createparent=true&amp;amp;overwrite=false" target="_blank"&gt;http://xxx:50075/webhdfs/v1/tmp/testa/a.txt?op=CREATE&amp;amp;user.name=livy&amp;amp;namenoderpcaddress=xxx:8020&amp;amp;createflag=&amp;amp;createparent=true&amp;amp;overwrite=false&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 01:51:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-upload-a-file-to-HDFS-using-Webhdfs-rest-api/m-p/201556#M68630</guid>
      <dc:creator>asirna</dc:creator>
      <dc:date>2017-09-27T01:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to upload a file to HDFS using Webhdfs rest api</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-upload-a-file-to-HDFS-using-Webhdfs-rest-api/m-p/201557#M68631</link>
      <description>&lt;P&gt;It worked. Thanks. &lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 02:01:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-upload-a-file-to-HDFS-using-Webhdfs-rest-api/m-p/201557#M68631</guid>
      <dc:creator>yvora</dc:creator>
      <dc:date>2017-09-27T02:01:24Z</dc:date>
    </item>
  </channel>
</rss>

