Return-Path: Delivered-To: apmail-hc-dev-archive@www.apache.org Received: (qmail 56383 invoked from network); 21 Apr 2008 15:41:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Apr 2008 15:41:25 -0000 Received: (qmail 5128 invoked by uid 500); 21 Apr 2008 15:41:16 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 5100 invoked by uid 500); 21 Apr 2008 15:41:16 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 5083 invoked by uid 99); 21 Apr 2008 15:41:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Apr 2008 08:41:16 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of piersony@gmail.com designates 66.249.92.171 as permitted sender) Received: from [66.249.92.171] (HELO ug-out-1314.google.com) (66.249.92.171) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Apr 2008 15:40:24 +0000 Received: by ug-out-1314.google.com with SMTP id j40so757485ugd.19 for ; Mon, 21 Apr 2008 08:40:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=T4mE3y4mkxtNEnMQVju/XgsH6vP7xNA7lLZQvQPJ+m4=; b=i2gyLOlA9j9MR3UYRh+rbRT06qfbQ71F5vOgFrSF+KtbBjE4AInLjCan84TCvjrB9hhpPH4aMW0xgCkic5e58TsiJBJpouRD8Lbr8ycKBG9cl2TS+C71n6UrxeyOuWlr9L4UqslIltRdCulqDIH6BpQqHfJ87itpSkVDnwMPhgs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=DlA29eqUc2fUo7KVqYSofq5doZz//kyQRaG+56yQiO4SZhJ2vlzOYi7N/5YGN5c2Mu8a7jFJeZ5YvqmMtjwJejQqXXkNG2HpXK4bbTPkDVE1mekA08miLh7ZTMbMrzje/wZRxKVmq8ZR0LIfefXG87egOHntkmccobv5l1J5OYU= Received: by 10.78.143.19 with SMTP id q19mr6478925hud.54.1208791827659; Mon, 21 Apr 2008 08:30:27 -0700 (PDT) Received: by 10.78.166.10 with HTTP; Mon, 21 Apr 2008 08:30:22 -0700 (PDT) Message-ID: <60d6743e0804210830o7697fcedi6cbcb674a32ce5b0@mail.gmail.com> Date: Mon, 21 Apr 2008 17:30:22 +0200 From: "Yannick PIERSON" To: dev@hc.apache.org Subject: httpClient upload file MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_946_23207924.1208791827666" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_946_23207924.1208791827666 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, I need some help in order to upload a file on a IIS remote server through webdav. My aim is to upload the file from "c:\\temp\\conf_250206.pdf" to " http://computer_name/webdav_access/Docs/ " I started with this code but it doesn't work : DefaultHttpClient httpclient = new DefaultHttpClient(); httpclient.getCredentialsProvider().setCredentials(new AuthScope("localhost", 80), new UsernamePasswordCredentials("admin", "admin")); HttpPost httppost = new HttpPost("http://computer_name/webdav_access/Docs "); File file = new File("c:\\temp\\conf_250206.pdf"); InputStreamEntity reqEntity = new InputStreamEntity(new FileInputStream(file), -1); reqEntity.setContentType("binary/octet-stream"); reqEntity.setChunked(true); FileEntity entity = new FileEntity(file, "binary/octet-stream"); httppost.setEntity(reqEntity); HttpResponse response = httpclient.execute(httppost); ... Must I use a servlet. If yes, why ? Thanks. Regards. Yannick ------=_Part_946_23207924.1208791827666--