Return-Path: X-Original-To: apmail-hadoop-common-user-archive@www.apache.org Delivered-To: apmail-hadoop-common-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 031351068D for ; Fri, 31 May 2013 17:10:08 +0000 (UTC) Received: (qmail 55639 invoked by uid 500); 31 May 2013 17:10:03 -0000 Delivered-To: apmail-hadoop-common-user-archive@hadoop.apache.org Received: (qmail 55373 invoked by uid 500); 31 May 2013 17:10:03 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 55355 invoked by uid 99); 31 May 2013 17:10:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 May 2013 17:10:02 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of prvs=8561704a5=afaris@linkedin.com designates 69.28.149.81 as permitted sender) Received: from [69.28.149.81] (HELO esv4-mav05.corp.linkedin.com) (69.28.149.81) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 May 2013 17:09:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkedin.com; i=@linkedin.com; q=dns/txt; s=proddkim1024; t=1370020197; x=1401556197; h=from:to:subject:date:message-id:references:in-reply-to: content-id:content-transfer-encoding:mime-version; bh=EwSxwn+/q6Rl1k87WWwrjndlQDYOiwgdQli84lYlouU=; b=J36Y1d0Dsb1dgz24mygyw53ocU3aIWzWVqpH6GFCWWGnlP0JvcVvP+8r aqem5T59mmRl6qO1zz7MgPcMLOwutJQlY3NcdLthRXY66Mf9JqCZ/rhrT imdyoOqfEKFECrZ9/QzM8OY4gteKT/0LhDT8r7arYfVyqupp8ttRhY8iw E=; X-IronPort-AV: E=Sophos;i="4.87,780,1363158000"; d="scan'208";a="51450727" Received: from ESV4-HT02.linkedin.biz (172.18.46.236) by esv4-cas01.linkedin.biz (172.18.46.140) with Microsoft SMTP Server (TLS) id 14.2.328.11; Fri, 31 May 2013 10:09:26 -0700 Received: from ESV4-MBX02.linkedin.biz ([fe80::20f1:6264:6880:7fc7]) by ESV4-HT02.linkedin.biz ([::1]) with mapi id 14.02.0328.009; Fri, 31 May 2013 10:09:26 -0700 From: Adam Faris To: "" Subject: Re: How can we download a file using WebHDFS REST API Thread-Topic: How can we download a file using WebHDFS REST API Thread-Index: AQHOXcpqY7anK63C8EmsVhd9VAeP1Jkf+IGAgAAA5YCAAAJjgIAAATkA Date: Fri, 31 May 2013 17:09:25 +0000 Message-ID: <3DB84EA5F65C804D98EE9F8562FAA53B513AB51C@ESV4-MBX02.linkedin.biz> References: <9D1A927C-E875-4171-A9B7-F28591D0345C@hortonworks.com> <62AC5F75-8D54-4122-A0D4-BCF1397D4B24@hortonworks.com> In-Reply-To: <62AC5F75-8D54-4122-A0D4-BCF1397D4B24@hortonworks.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.18.46.252] Content-Type: text/plain; charset="iso-8859-1" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org As others have suggested, you need to call "&op=3DOPEN" and save the conten= ts into a buffer which you then write to disk. You can do this with curl= by using '-o /my/local/file.txt' in your curl statement. -- Adam On May 31, 2013, at 10:05 AM, Arpit Gupta wrote: > There is no api to download a file. The client you are using to make thes= e calls will have to read the contents of the file and save it on your loca= l file system. >=20 > -- > Arpit Gupta > Hortonworks Inc. > http://hortonworks.com/ >=20 > On May 31, 2013, at 9:56 AM, Mohammad Mustaqeem <3m.mustaqeem@gmail.com> = wrote: >=20 >> This is for reading the content of the file not to download.. >> I want to download file. >>=20 >>=20 >> On Fri, May 31, 2013 at 10:23 PM, Arpit Gupta wr= ote: >> you will have to use the open operation to read the file and save it. >>=20 >> http://hadoop.apache.org/docs/r2.0.3-alpha/hadoop-project-dist/hadoop-hd= fs/WebHDFS.html#Open_and_Read_a_File >>=20 >> -- >> Arpit Gupta >> Hortonworks Inc. >> http://hortonworks.com/ >>=20 >> On May 30, 2013, at 11:44 PM, Mohammad Mustaqeem <3m.mustaqeem@gmail.com= > wrote: >>=20 >>> Is there any way to download a file from HDFS using WebHDFS REST API? >>> I have read - http://hadoop.apache.org/docs/r2.0.3-alpha/hadoop-project= -dist/hadoop-hdfs/WebHDFS.html >>>=20 >>> But didn't find any way to download file. >>>=20 >>> --=20 >>> With regards --- >>> Mohammad Mustaqeem, >>> M.Tech (CSE) >>> MNNIT Allahabad >>> 9026604270 >>>=20 >>>=20 >>=20 >>=20 >>=20 >>=20 >> --=20 >> With regards --- >> Mohammad Mustaqeem, >> M.Tech (CSE) >> MNNIT Allahabad >> 9026604270 >>=20 >>=20 >=20