tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: multipart/form-data support
Date Mon, 03 Jan 2011 17:59:13 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Pankaj,

On 1/2/2011 10:06 PM, Pankaj Tiwari wrote:
> I have been trying to send multipart/form-data to the server. I have found
> that the request never reaches the server.

How are you checking to see if it reaches the server?

> This is my client code, if I am missing something core in here.
> 
>     public static void main(String args[])
>     {
>         try
>         {
>             URL url = new URL(SERVERURL);

What is SERVERURL?

>             con.setDoInput(true);
>             con.setDoOutput(true);

...

>             OutputStream out = con.getOutputStream();
>             DataOutputStream oos = new DataOutputStream(out);

I agree with Pid: why are you using DataOutputStream?

>             oos.writeBytes(TWOHYPHENS + BOUNDARY + LINEEND);

Hmm... write before connect?

>             oos.flush();
>             con.connect();

Try connecting before writing. Also, try reading the response (you did
setDoInput(true)...).

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk0iDnEACgkQ9CaO5/Lv0PD6AQCfctFc2yULc7QkATMx1fAqwe5F
km4AniigJu80/uJ6gl1Kg/6WD1i+rv/I
=KmrY
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message