Return-Path: Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: (qmail 17002 invoked from network); 22 Apr 2008 07:38:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Apr 2008 07:38:41 -0000 Received: (qmail 59163 invoked by uid 500); 22 Apr 2008 07:38:40 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 59144 invoked by uid 500); 22 Apr 2008 07:38:40 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 59133 invoked by uid 99); 22 Apr 2008 07:38:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Apr 2008 00:38:40 -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 (athena.apache.org: domain of piersony@gmail.com designates 64.233.182.185 as permitted sender) Received: from [64.233.182.185] (HELO nf-out-0910.google.com) (64.233.182.185) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Apr 2008 07:37:57 +0000 Received: by nf-out-0910.google.com with SMTP id b11so688038nfh.48 for ; Tue, 22 Apr 2008 00:38:09 -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=iqzU904nkT5AQnKWAE2WVX6gPYBQ/9QMIGwppCFT0WE=; b=NeqFAjxG6a0w/RVJGDnfRr1/t+GDNfTpjLJM6L6+vzkLumsHE2WwfsRBpzUUbn1R+1UdhloqfhWY3Jq/5RWMS7CRNnDl4KqCQK+fdMU03ot1sD1wy59zgdC4Z9ugHL7paiQO5puogGiohGYHfzJIWd8bj6IOuRYLim9PWJHEbqg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=M9VMMdEGTW+d6fE7VWY+EDSIXN55v78HD/oKkj+Ia0T860TCfjGAO/N8I6kLRZZQYLXYkYWCbf/n07XIarBhQMmMHYI1f/ibXTjY2sC9em0HZlieypvtLoQJ6ZRUN4+lDia0/AjKgEZCvpYT3UUD2SpGilKaywSDQY7B+SNaUAU= Received: by 10.78.199.8 with SMTP id w8mr3560221huf.30.1208849889086; Tue, 22 Apr 2008 00:38:09 -0700 (PDT) Received: by 10.78.166.10 with HTTP; Tue, 22 Apr 2008 00:38:08 -0700 (PDT) Message-ID: <60d6743e0804220038i649f2826t82e5f616934c39ac@mail.gmail.com> Date: Tue, 22 Apr 2008 09:38:08 +0200 From: "Yannick PIERSON" To: httpclient-users@hc.apache.org Subject: store file MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_566_32107942.1208849888961" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_566_32107942.1208849888961 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, I'm using the library HttpClient 3.1 and I'm trying to store a file on a IIS server. I've ever developed a method which download a file from this server. But I'm blocked in order to upload a file. I've read documents from apache site and others,but must I use a servlet ? If yes, why ? I don't understand its utility. For that I ever done : HttpClient client = new HttpClient(); Credentials credentials = new NTCredentials("test", "test", "homecomputer ", "WORKGROUP"); HttpState state = client.getState(); state.setCredentials(null, null, credentials); PutMethod put = new PutMethod("http://computer_name/webdav_acces/"); put.setRequestBody(new FileInputStream("c:\\temp\\myFileToStore.pdf")); client.executeMethod(put); put.releaseConnection(); ------------------------------------- Unfortunately I get this error : java.net.SocketException: Software caused connection abort: socket write error at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at java.io.BufferedOutputStream.write(BufferedOutputStream.java:105) at java.io.FilterOutputStream.write(FilterOutputStream.java:80) at org.apache.commons.httpclient.WireLogOutputStream.write(WireLogOutputStream.java:86) at org.apache.commons.httpclient.methods.InputStreamRequestEntity.writeRequest(InputStreamRequestEntity.java:175) at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:499) at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114) at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323) at javaapplication1.HttpClt.myPost(HttpClt.java:79) at javaapplication1.Main.main(Main.java:42) Thanks for your help, Regards. Yannick ------=_Part_566_32107942.1208849888961--